From 9c474710678f23186119ba5f8c86419d185abc25 Mon Sep 17 00:00:00 2001 From: Muthiah Muralidharan Date: Thu, 12 Nov 2026 11:28:09 +0530 Subject: [PATCH] fix(cli): rename live-site write confirmation flag to --allow-write `customer create --yes` does not say what is being agreed to. API write commands now take --allow-write to confirm a write on a live site without the prompt. -y/--yes keeps working as a hidden, deprecated alias that prints a warning naming --allow-write; it will be removed in the next major version. The -y/--yes on `auth remove` and `skills` is unchanged. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 4 +- README.md | 2 +- src/commands/auth.ts | 4 +- src/commands/generated/addon.ts | 35 +-- src/commands/generated/address.ts | 7 +- src/commands/generated/alert.ts | 21 +- src/commands/generated/attached_item.ts | 21 +- src/commands/generated/business_entity.ts | 21 +- src/commands/generated/business_rule.ts | 56 ++-- src/commands/generated/business_ruleset.ts | 49 ++-- src/commands/generated/card.ts | 28 +- .../generated/collections_payment_promise.ts | 21 +- src/commands/generated/comment.ts | 14 +- src/commands/generated/coupon.ts | 49 ++-- src/commands/generated/coupon_code.ts | 14 +- src/commands/generated/coupon_set.ts | 35 +-- src/commands/generated/credit_note.ts | 77 +++--- src/commands/generated/credit_unit.ts | 28 +- src/commands/generated/currency.ts | 28 +- src/commands/generated/customer.ts | 154 ++++++----- src/commands/generated/differential_price.ts | 21 +- src/commands/generated/entitlement.ts | 7 +- .../generated/entitlement_override.ts | 7 +- src/commands/generated/feature.ts | 42 +-- src/commands/generated/gift.ts | 35 +-- src/commands/generated/hosted_page.ts | 14 +- src/commands/generated/in_app_subscription.ts | 21 +- src/commands/generated/invoice.ts | 245 ++++++++++-------- src/commands/generated/item.ts | 21 +- src/commands/generated/item_entitlement.ts | 14 +- src/commands/generated/item_family.ts | 21 +- src/commands/generated/item_price.ts | 21 +- .../generated/ledger_account_balance.ts | 7 +- src/commands/generated/ledger_operation.ts | 35 +-- src/commands/generated/metered_feature.ts | 28 +- src/commands/generated/non_subscription.ts | 7 +- src/commands/generated/offer_event.ts | 7 +- src/commands/generated/offer_fulfillment.ts | 14 +- .../generated/omnichannel_subscription.ts | 7 +- src/commands/generated/order.ts | 63 +++-- src/commands/generated/payment_intent.ts | 14 +- .../generated/payment_schedule_scheme.ts | 14 +- src/commands/generated/payment_source.ts | 98 ++++--- src/commands/generated/payment_voucher.ts | 7 +- src/commands/generated/personalized_offer.ts | 7 +- src/commands/generated/plan.ts | 35 +-- src/commands/generated/portal_session.ts | 14 +- src/commands/generated/price_ramp.ts | 21 +- src/commands/generated/price_variant.ts | 21 +- .../generated/pricing_page_session.ts | 14 +- src/commands/generated/promotional_credit.ts | 21 +- src/commands/generated/promotional_grant.ts | 7 +- src/commands/generated/purchase.ts | 14 +- src/commands/generated/quote.ts | 140 +++++----- src/commands/generated/ramp.ts | 21 +- src/commands/generated/recorded_purchase.ts | 7 +- src/commands/generated/subscription.ts | 210 ++++++++------- .../generated/subscription_entitlement.ts | 7 +- src/commands/generated/time_machine.ts | 14 +- src/commands/generated/transaction.ts | 42 +-- src/commands/generated/unbilled_charge.ts | 35 +-- src/commands/generated/usage.ts | 14 +- src/commands/generated/usage_event.ts | 14 +- src/commands/generated/usage_file.ts | 7 +- .../generated/virtual_bank_account.ts | 28 +- src/commands/generated/webhook_endpoint.ts | 21 +- src/commands/help.ts | 2 +- src/lib/api/sdk.ts | 14 +- src/lib/api/write-gate.ts | 18 +- src/lib/skills/content/SKILL.md | 6 +- src/lib/skills/content/references/commands.md | 6 +- .../skills/content/references/workflows.md | 2 +- .../integration/live-site-write-gate.test.ts | 50 +++- src/tests/unit/lib/api/write-gate.test.ts | 20 +- src/tools/generate.ts | 8 +- 75 files changed, 1313 insertions(+), 965 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5b64ec4..03b52aa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -111,7 +111,7 @@ Do not introduce additional credential storage paths without an explicit require Generated API commands enforce two protections: -- **Write gate:** Write operations on live sites require confirmation: an interactive yes/no prompt, or `-y/--yes`. Without a terminal (or on a CI runner, or in `--json` mode) and without `--yes`, the write is refused with exit code 6. Test sites, reads, and non-mutating POSTs (estimates, exports, hosted-page URLs, PDF downloads) never prompt. +- **Write gate:** Write operations on live sites require confirmation: an interactive yes/no prompt, or `--allow-write`. Without a terminal (or on a CI runner, or in `--json` mode) and without `--allow-write`, the write is refused with exit code 6. Test sites, reads, and non-mutating POSTs (estimates, exports, hosted-page URLs, PDF downloads) never prompt. - **Catalog gate:** Product Catalog-specific operations are blocked when they do not match the configured site's catalog version. For `--code-sample`, the **write gate does not apply** because no API request is executed. The **catalog gate still applies** so generated code matches the site's Product Catalog version. @@ -146,7 +146,7 @@ Run live tests with: bun run test:live ``` -Never permit successful writes on live Chargebee sites in automated tests, and never pass `--yes` to a live-site write in live tests. Live-site customer-create tests must assert the CLI write gate refuses the unconfirmed operation; use a dedicated validation site and read-only key. Successful remote writes are limited to customer creation and cleanup deletion on test sites. +Never permit successful writes on live Chargebee sites in automated tests, and never pass `--allow-write` to a live-site write in live tests. Live-site customer-create tests must assert the CLI write gate refuses the unconfirmed operation; use a dedicated validation site and read-only key. Successful remote writes are limited to customer creation and cleanup deletion on test sites. Shared test helpers belong in `src/lib/test-support/` and must never be imported by production entry points or commands. diff --git a/README.md b/README.md index b8f1078..cfbae45 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ export CHARGEBEE_API_KEY=test_xxxxxxxxxxxx Create API keys from **Settings → Configure Chargebee → API Keys** in the Chargebee Dashboard. -> Write operations on live sites ask for confirmation before they run. In scripts, CI, or `--json` mode, add `--yes` to confirm; without it the command exits with code `6`. Use a test site when building or testing integrations. +> Write operations on live sites ask for confirmation before they run. In scripts, CI, or `--json` mode, add `--allow-write` to confirm; without it the command exits with code `6`. Use a test site when building or testing integrations. ## Quick Example diff --git a/src/commands/auth.ts b/src/commands/auth.ts index 698ea6a..eed09ea 100644 --- a/src/commands/auth.ts +++ b/src/commands/auth.ts @@ -241,8 +241,8 @@ ${sectionTitle("EXAMPLES")} chargebee auth add Connect a site interactively chargebee auth add --profile staging Save credentials as staging -Writes on live sites ask for confirmation (or need --yes): a site whose name -doesn't end in -test, unless its API key starts with test_. Prefer +Writes on live sites ask for confirmation (or need --allow-write): a site +whose name doesn't end in -test, unless its API key starts with test_. Prefer CHARGEBEE_API_KEY over --api-key so the secret is not stored in shell history. --region (${REGIONS.join(" | ")}) records where the site is hosted and is used to diff --git a/src/commands/generated/addon.ts b/src/commands/generated/addon.ts index f70aaa4..f7c8c34 100644 --- a/src/commands/generated/addon.ts +++ b/src/commands/generated/addon.ts @@ -23,14 +23,15 @@ export function registerAddon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs addon copy\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "copy_an_addon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "addon copy"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "copy_an_addon", method: "POST", uri: "/addons/copy", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "addon copy", opts.yes === true); + await ensureWriteAllowed("POST", "addon copy", opts); try { const client = await getClient(); const result = await (client as any).addon.copy(params); @@ -45,14 +46,15 @@ export function registerAddon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs addon create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_an_addon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "addon create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_an_addon", method: "POST", uri: "/addons", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "addon create", opts.yes === true); + await ensureWriteAllowed("POST", "addon create", opts); try { const client = await getClient(); const result = await (client as any).addon.create(params); @@ -68,16 +70,17 @@ export function registerAddon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs addon delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "delete_an_addon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "addon delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "delete_an_addon", method: "POST", uri: "/addons/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "addon-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'addon-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "addon delete", opts.yes === true); + await ensureWriteAllowed("POST", "addon delete", opts); try { const client = await getClient(); const result = await (client as any).addon.delete(resource.id, params); @@ -139,16 +142,17 @@ export function registerAddon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs addon unarchive\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "unarchive_an_addon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "addon unarchive"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "unarchive_an_addon", method: "POST", uri: "/addons/{id}/unarchive", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "addon-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'addon-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "addon unarchive", opts.yes === true); + await ensureWriteAllowed("POST", "addon unarchive", opts); try { const client = await getClient(); const result = await (client as any).addon.unarchive(resource.id, params); @@ -164,16 +168,17 @@ export function registerAddon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs addon update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "update_an_addon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "addon update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "update_an_addon", method: "POST", uri: "/addons/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "addon-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'addon-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "addon update", opts.yes === true); + await ensureWriteAllowed("POST", "addon update", opts); try { const client = await getClient(); const result = await (client as any).addon.update(resource.id, params); diff --git a/src/commands/generated/address.ts b/src/commands/generated/address.ts index 9232176..c02702d 100644 --- a/src/commands/generated/address.ts +++ b/src/commands/generated/address.ts @@ -41,13 +41,14 @@ export function registerAddress(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs address update\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_an_address", opIdV1: "update_an_address", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_an_address", opIdV1: "update_an_address", method: "POST", uri: "/addresses", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "address update", opts.yes === true); + await ensureWriteAllowed("POST", "address update", opts); try { const client = await getClient(); const result = await (client as any).address.update(params); diff --git a/src/commands/generated/alert.ts b/src/commands/generated/alert.ts index 14f85cf..d2fa9d8 100644 --- a/src/commands/generated/alert.ts +++ b/src/commands/generated/alert.ts @@ -47,14 +47,15 @@ export function registerAlert(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs alert create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_alert", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "alert create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_alert", opIdV1: "", method: "POST", uri: "/alerts", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "alert create", opts.yes === true); + await ensureWriteAllowed("POST", "alert create", opts); try { const client = await getClient(); const result = await (client as any).alert.create(params); @@ -70,16 +71,17 @@ export function registerAlert(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs alert delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_alert", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "alert delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_alert", opIdV1: "", method: "POST", uri: "/alerts/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "alert-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'alert-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "alert delete", opts.yes === true); + await ensureWriteAllowed("POST", "alert delete", opts); try { const client = await getClient(); const result = await (client as any).alert.delete(resource.id, params); @@ -141,16 +143,17 @@ export function registerAlert(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs alert update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_an_alert", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "alert update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_an_alert", opIdV1: "", method: "POST", uri: "/alerts/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "alert-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'alert-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "alert update", opts.yes === true); + await ensureWriteAllowed("POST", "alert update", opts); try { const client = await getClient(); const result = await (client as any).alert.update(resource.id, params); diff --git a/src/commands/generated/attached_item.ts b/src/commands/generated/attached_item.ts index 113805f..645b6f6 100644 --- a/src/commands/generated/attached_item.ts +++ b/src/commands/generated/attached_item.ts @@ -25,16 +25,17 @@ export function registerAttachedItem(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs attached-item create\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_attached_item", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "attached-item create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_attached_item", opIdV1: "", method: "POST", uri: "/items/{id}/attached_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "attached-item create", opts.yes === true); + await ensureWriteAllowed("POST", "attached-item create", opts); try { const client = await getClient(); const result = await (client as any).attachedItem.create(resource.id, params); @@ -50,16 +51,17 @@ export function registerAttachedItem(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs attached-item delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_attached_item", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "attached-item delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_attached_item", opIdV1: "", method: "POST", uri: "/attached_items/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "attached-item-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'attached-item-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "attached-item delete", opts.yes === true); + await ensureWriteAllowed("POST", "attached-item delete", opts); try { const client = await getClient(); const result = await (client as any).attachedItem.delete(resource.id, params); @@ -124,16 +126,17 @@ export function registerAttachedItem(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs attached-item update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_an_attached_item", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "attached-item update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_an_attached_item", opIdV1: "", method: "POST", uri: "/attached_items/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "attached-item-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'attached-item-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "attached-item update", opts.yes === true); + await ensureWriteAllowed("POST", "attached-item update", opts); try { const client = await getClient(); const result = await (client as any).attachedItem.update(resource.id, params); diff --git a/src/commands/generated/business_entity.ts b/src/commands/generated/business_entity.ts index 646b189..c0732cc 100644 --- a/src/commands/generated/business_entity.ts +++ b/src/commands/generated/business_entity.ts @@ -24,14 +24,15 @@ export function registerBusinessEntity(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-entity create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_business_entity", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-entity create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_business_entity", opIdV1: "", method: "POST", uri: "/business_entities", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "business-entity create", opts.yes === true); + await ensureWriteAllowed("POST", "business-entity create", opts); try { const client = await getClient(); const result = await (client as any).businessEntity.create(params); @@ -46,14 +47,15 @@ export function registerBusinessEntity(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-entity create-transfers\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "transfer_resources_to_another_business_entity", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-entity create-transfers"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "transfer_resources_to_another_business_entity", opIdV1: "", method: "POST", uri: "/business_entities/transfers", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "business-entity create-transfers", opts.yes === true); + await ensureWriteAllowed("POST", "business-entity create-transfers", opts); try { const client = await getClient(); const result = await (client as any).businessEntity.createTransfers(params); @@ -135,16 +137,17 @@ export function registerBusinessEntity(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-entity update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_business_entity", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-entity update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_business_entity", opIdV1: "", method: "POST", uri: "/business_entities/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-entity-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-entity-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-entity update", opts.yes === true); + await ensureWriteAllowed("POST", "business-entity update", opts); try { const client = await getClient(); const result = await (client as any).businessEntity.update(resource.id, params); diff --git a/src/commands/generated/business_rule.ts b/src/commands/generated/business_rule.ts index ad61830..e3de04b 100644 --- a/src/commands/generated/business_rule.ts +++ b/src/commands/generated/business_rule.ts @@ -25,16 +25,17 @@ export function registerBusinessRule(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-rule activate-rule\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "activate_a_business_rule", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-rule activate-rule"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "activate_a_business_rule", opIdV1: "", method: "POST", uri: "/business_rules/{id}/activate", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-rule-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-rule-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-rule activate-rule", opts.yes === true); + await ensureWriteAllowed("POST", "business-rule activate-rule", opts); try { const client = await getClient(); const result = await (client as any).businessRule.activateRule(resource.id, params); @@ -49,14 +50,15 @@ export function registerBusinessRule(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-rule apply-rules\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "apply_business_rules", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-rule apply-rules"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "apply_business_rules", opIdV1: "", method: "POST", uri: "/business_rules/apply_rules", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "business-rule apply-rules", opts.yes === true); + await ensureWriteAllowed("POST", "business-rule apply-rules", opts); try { const client = await getClient(); const result = await (client as any).businessRule.applyRules(params); @@ -71,14 +73,15 @@ export function registerBusinessRule(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-rule create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_business_rule", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-rule create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_business_rule", opIdV1: "", method: "POST", uri: "/business_rules", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "business-rule create", opts.yes === true); + await ensureWriteAllowed("POST", "business-rule create", opts); try { const client = await getClient(); const result = await (client as any).businessRule.create(params); @@ -94,16 +97,17 @@ export function registerBusinessRule(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-rule deactivate-rule\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "deactivate_a_business_rule", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-rule deactivate-rule"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "deactivate_a_business_rule", opIdV1: "", method: "POST", uri: "/business_rules/{id}/deactivate", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-rule-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-rule-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-rule deactivate-rule", opts.yes === true); + await ensureWriteAllowed("POST", "business-rule deactivate-rule", opts); try { const client = await getClient(); const result = await (client as any).businessRule.deactivateRule(resource.id, params); @@ -119,16 +123,17 @@ export function registerBusinessRule(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-rule delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_business_rule", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-rule delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_business_rule", opIdV1: "", method: "POST", uri: "/business_rules/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-rule-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-rule-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-rule delete", opts.yes === true); + await ensureWriteAllowed("POST", "business-rule delete", opts); try { const client = await getClient(); const result = await (client as any).businessRule.delete(resource.id, params); @@ -144,16 +149,17 @@ export function registerBusinessRule(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-rule delete-draft\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_business_rule_draft", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-rule delete-draft"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_business_rule_draft", opIdV1: "", method: "POST", uri: "/business_rules/{id}/delete_draft", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-rule-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-rule-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-rule delete-draft", opts.yes === true); + await ensureWriteAllowed("POST", "business-rule delete-draft", opts); try { const client = await getClient(); const result = await (client as any).businessRule.deleteDraft(resource.id, params); @@ -192,16 +198,17 @@ export function registerBusinessRule(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-rule release-rule\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "release_a_business_rule", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-rule release-rule"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "release_a_business_rule", opIdV1: "", method: "POST", uri: "/business_rules/{id}/release", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-rule-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-rule-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-rule release-rule", opts.yes === true); + await ensureWriteAllowed("POST", "business-rule release-rule", opts); try { const client = await getClient(); const result = await (client as any).businessRule.releaseRule(resource.id, params); @@ -263,16 +270,17 @@ export function registerBusinessRule(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-rule update-draft\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_business_rule_draft", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-rule update-draft"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_business_rule_draft", opIdV1: "", method: "POST", uri: "/business_rules/{id}/draft", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-rule-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-rule-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-rule update-draft", opts.yes === true); + await ensureWriteAllowed("POST", "business-rule update-draft", opts); try { const client = await getClient(); const result = await (client as any).businessRule.updateDraft(resource.id, params); diff --git a/src/commands/generated/business_ruleset.ts b/src/commands/generated/business_ruleset.ts index 79c1ee3..e7ba313 100644 --- a/src/commands/generated/business_ruleset.ts +++ b/src/commands/generated/business_ruleset.ts @@ -25,16 +25,17 @@ export function registerBusinessRuleset(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-ruleset activate\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "activate_a_business_ruleset", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-ruleset activate"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "activate_a_business_ruleset", opIdV1: "", method: "POST", uri: "/business_rulesets/{id}/activate", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-ruleset-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-ruleset-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-ruleset activate", opts.yes === true); + await ensureWriteAllowed("POST", "business-ruleset activate", opts); try { const client = await getClient(); const result = await (client as any).businessRuleset.activate(resource.id, params); @@ -50,16 +51,17 @@ export function registerBusinessRuleset(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-ruleset add-rules\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_business_rules_to_a_ruleset", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-ruleset add-rules"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_business_rules_to_a_ruleset", opIdV1: "", method: "POST", uri: "/business_rulesets/{id}/add_rules", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-ruleset-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-ruleset-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-ruleset add-rules", opts.yes === true); + await ensureWriteAllowed("POST", "business-ruleset add-rules", opts); try { const client = await getClient(); const result = await (client as any).businessRuleset.addRules(resource.id, params); @@ -74,14 +76,15 @@ export function registerBusinessRuleset(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-ruleset create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_business_ruleset", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-ruleset create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_business_ruleset", opIdV1: "", method: "POST", uri: "/business_rulesets", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "business-ruleset create", opts.yes === true); + await ensureWriteAllowed("POST", "business-ruleset create", opts); try { const client = await getClient(); const result = await (client as any).businessRuleset.create(params); @@ -97,16 +100,17 @@ export function registerBusinessRuleset(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-ruleset deactivate\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "deactivate_a_business_ruleset", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-ruleset deactivate"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "deactivate_a_business_ruleset", opIdV1: "", method: "POST", uri: "/business_rulesets/{id}/deactivate", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-ruleset-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-ruleset-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-ruleset deactivate", opts.yes === true); + await ensureWriteAllowed("POST", "business-ruleset deactivate", opts); try { const client = await getClient(); const result = await (client as any).businessRuleset.deactivate(resource.id, params); @@ -122,16 +126,17 @@ export function registerBusinessRuleset(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-ruleset delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_business_ruleset", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-ruleset delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_business_ruleset", opIdV1: "", method: "POST", uri: "/business_rulesets/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-ruleset-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-ruleset-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-ruleset delete", opts.yes === true); + await ensureWriteAllowed("POST", "business-ruleset delete", opts); try { const client = await getClient(); const result = await (client as any).businessRuleset.delete(resource.id, params); @@ -193,16 +198,17 @@ export function registerBusinessRuleset(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-ruleset remove-rules\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_business_rules_from_a_ruleset", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-ruleset remove-rules"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_business_rules_from_a_ruleset", opIdV1: "", method: "POST", uri: "/business_rulesets/{id}/remove_rules", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-ruleset-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-ruleset-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-ruleset remove-rules", opts.yes === true); + await ensureWriteAllowed("POST", "business-ruleset remove-rules", opts); try { const client = await getClient(); const result = await (client as any).businessRuleset.removeRules(resource.id, params); @@ -241,16 +247,17 @@ export function registerBusinessRuleset(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs business-ruleset update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_business_ruleset", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "business-ruleset update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_business_ruleset", opIdV1: "", method: "POST", uri: "/business_rulesets/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "business-ruleset-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'business-ruleset-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "business-ruleset update", opts.yes === true); + await ensureWriteAllowed("POST", "business-ruleset update", opts); try { const client = await getClient(); const result = await (client as any).businessRuleset.update(resource.id, params); diff --git a/src/commands/generated/card.ts b/src/commands/generated/card.ts index 0da6e9a..57381e1 100644 --- a/src/commands/generated/card.ts +++ b/src/commands/generated/card.ts @@ -23,15 +23,16 @@ export function registerCard(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs card copy-card-for-customer\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "copy_card", opIdV1: "copy_card", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "copy_card", opIdV1: "copy_card", method: "POST", uri: "/customers/{id}/copy_card", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "card copy-card-for-customer", opts.yes === true); + await ensureWriteAllowed("POST", "card copy-card-for-customer", opts); try { const client = await getClient(); const result = await (client as any).card.copyCardForCustomer(resource.id, params); @@ -47,15 +48,16 @@ export function registerCard(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs card delete-card-for-customer\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_card_for_a_customer", opIdV1: "delete_card_for_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_card_for_a_customer", opIdV1: "delete_card_for_a_customer", method: "POST", uri: "/customers/{id}/delete_card", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "card delete-card-for-customer", opts.yes === true); + await ensureWriteAllowed("POST", "card delete-card-for-customer", opts); try { const client = await getClient(); const result = await (client as any).card.deleteCardForCustomer(resource.id, params); @@ -93,15 +95,16 @@ export function registerCard(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs card switch-gateway-for-customer\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "switch_gateway", opIdV1: "switch_gateway", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "switch_gateway", opIdV1: "switch_gateway", method: "POST", uri: "/customers/{id}/switch_gateway", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "card switch-gateway-for-customer", opts.yes === true); + await ensureWriteAllowed("POST", "card switch-gateway-for-customer", opts); try { const client = await getClient(); const result = await (client as any).card.switchGatewayForCustomer(resource.id, params); @@ -117,15 +120,16 @@ export function registerCard(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs card update-card-for-customer\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_card_for_a_customer", opIdV1: "update_card_for_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_card_for_a_customer", opIdV1: "update_card_for_a_customer", method: "POST", uri: "/customers/{id}/credit_card", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "card update-card-for-customer", opts.yes === true); + await ensureWriteAllowed("POST", "card update-card-for-customer", opts); try { const client = await getClient(); const result = await (client as any).card.updateCardForCustomer(resource.id, params); diff --git a/src/commands/generated/collections_payment_promise.ts b/src/commands/generated/collections_payment_promise.ts index a89f68b..2eb8849 100644 --- a/src/commands/generated/collections_payment_promise.ts +++ b/src/commands/generated/collections_payment_promise.ts @@ -24,15 +24,16 @@ export function registerCollectionsPaymentPromise(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs collections-payment-promise cancel\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "cancel_a_collections_payment_promise", opIdV1: "cancel_a_collections_payment_promise", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "cancel_a_collections_payment_promise", opIdV1: "cancel_a_collections_payment_promise", method: "POST", uri: "/collections_payment_promises/{id}/cancel", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "collections-payment-promise-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'collections-payment-promise-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "collections-payment-promise cancel", opts.yes === true); + await ensureWriteAllowed("POST", "collections-payment-promise cancel", opts); try { const client = await getClient(); const result = await (client as any).collectionsPaymentPromise.cancel(resource.id, params); @@ -47,13 +48,14 @@ export function registerCollectionsPaymentPromise(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs collections-payment-promise create-collections-payment-promise\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_collections_payment_promise", opIdV1: "create_a_collections_payment_promise", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_collections_payment_promise", opIdV1: "create_a_collections_payment_promise", method: "POST", uri: "/collections_payment_promises", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "collections-payment-promise create-collections-payment-promise", opts.yes === true); + await ensureWriteAllowed("POST", "collections-payment-promise create-collections-payment-promise", opts); try { const client = await getClient(); const result = await (client as any).collectionsPaymentPromise.createCollectionsPaymentPromise(params); @@ -110,15 +112,16 @@ export function registerCollectionsPaymentPromise(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs collections-payment-promise update-collections-payment-promise\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_collections_payment_promise", opIdV1: "update_a_collections_payment_promise", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_collections_payment_promise", opIdV1: "update_a_collections_payment_promise", method: "POST", uri: "/collections_payment_promises/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "collections-payment-promise-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'collections-payment-promise-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "collections-payment-promise update-collections-payment-promise", opts.yes === true); + await ensureWriteAllowed("POST", "collections-payment-promise update-collections-payment-promise", opts); try { const client = await getClient(); const result = await (client as any).collectionsPaymentPromise.updateCollectionsPaymentPromise(resource.id, params); diff --git a/src/commands/generated/comment.ts b/src/commands/generated/comment.ts index 222cb84..d5f7b73 100644 --- a/src/commands/generated/comment.ts +++ b/src/commands/generated/comment.ts @@ -23,13 +23,14 @@ export function registerComment(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs comment create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_comment", opIdV1: "create_a_comment", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_comment", opIdV1: "create_a_comment", method: "POST", uri: "/comments", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "comment create", opts.yes === true); + await ensureWriteAllowed("POST", "comment create", opts); try { const client = await getClient(); const result = await (client as any).comment.create(params); @@ -45,15 +46,16 @@ export function registerComment(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs comment delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_comment", opIdV1: "delete_a_comment", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_comment", opIdV1: "delete_a_comment", method: "POST", uri: "/comments/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "comment-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'comment-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "comment delete", opts.yes === true); + await ensureWriteAllowed("POST", "comment delete", opts); try { const client = await getClient(); const result = await (client as any).comment.delete(resource.id, params); diff --git a/src/commands/generated/coupon.ts b/src/commands/generated/coupon.ts index ccd49a2..ad9235a 100644 --- a/src/commands/generated/coupon.ts +++ b/src/commands/generated/coupon.ts @@ -23,13 +23,14 @@ export function registerCoupon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon copy\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "copy_a_coupon", opIdV1: "copy_a_coupon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "copy_a_coupon", opIdV1: "copy_a_coupon", method: "POST", uri: "/coupons/copy", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "coupon copy", opts.yes === true); + await ensureWriteAllowed("POST", "coupon copy", opts); try { const client = await getClient(); const result = await (client as any).coupon.copy(params); @@ -44,14 +45,15 @@ export function registerCoupon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_a_coupon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "coupon create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_a_coupon", method: "POST", uri: "/coupons", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "coupon create", opts.yes === true); + await ensureWriteAllowed("POST", "coupon create", opts); try { const client = await getClient(); const result = await (client as any).coupon.create(params); @@ -66,14 +68,15 @@ export function registerCoupon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon create-for-items\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_coupon_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "coupon create-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_coupon_for_items", opIdV1: "", method: "POST", uri: "/coupons/create_for_items", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "coupon create-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "coupon create-for-items", opts); try { const client = await getClient(); const result = await (client as any).coupon.createForItems(params); @@ -89,15 +92,16 @@ export function registerCoupon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_coupon", opIdV1: "delete_a_coupon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_coupon", opIdV1: "delete_a_coupon", method: "POST", uri: "/coupons/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon delete", opts.yes === true); + await ensureWriteAllowed("POST", "coupon delete", opts); try { const client = await getClient(); const result = await (client as any).coupon.delete(resource.id, params); @@ -157,15 +161,16 @@ export function registerCoupon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon unarchive\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "unarchive_a_coupon", opIdV1: "unarchive_a_coupon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "unarchive_a_coupon", opIdV1: "unarchive_a_coupon", method: "POST", uri: "/coupons/{id}/unarchive", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon unarchive", opts.yes === true); + await ensureWriteAllowed("POST", "coupon unarchive", opts); try { const client = await getClient(); const result = await (client as any).coupon.unarchive(resource.id, params); @@ -181,16 +186,17 @@ export function registerCoupon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "update_a_coupon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "coupon update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "update_a_coupon", method: "POST", uri: "/coupons/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon update", opts.yes === true); + await ensureWriteAllowed("POST", "coupon update", opts); try { const client = await getClient(); const result = await (client as any).coupon.update(resource.id, params); @@ -206,16 +212,17 @@ export function registerCoupon(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon update-for-items\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_coupon_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "coupon update-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_coupon_for_items", opIdV1: "", method: "POST", uri: "/coupons/{id}/update_for_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon update-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "coupon update-for-items", opts); try { const client = await getClient(); const result = await (client as any).coupon.updateForItems(resource.id, params); diff --git a/src/commands/generated/coupon_code.ts b/src/commands/generated/coupon_code.ts index 09ef4e5..a6189ac 100644 --- a/src/commands/generated/coupon_code.ts +++ b/src/commands/generated/coupon_code.ts @@ -25,15 +25,16 @@ export function registerCouponCode(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon-code archive\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "archive_a_coupon_code", opIdV1: "archive_a_coupon_code", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "archive_a_coupon_code", opIdV1: "archive_a_coupon_code", method: "POST", uri: "/coupon_codes/{id}/archive", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-code-code", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-code-code'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon-code archive", opts.yes === true); + await ensureWriteAllowed("POST", "coupon-code archive", opts); try { const client = await getClient(); const result = await (client as any).couponCode.archive(resource.id, params); @@ -48,13 +49,14 @@ export function registerCouponCode(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon-code create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/coupon_codes", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "coupon-code create", opts.yes === true); + await ensureWriteAllowed("POST", "coupon-code create", opts); try { const client = await getClient(); const result = await (client as any).couponCode.create(params); diff --git a/src/commands/generated/coupon_set.ts b/src/commands/generated/coupon_set.ts index 4474fdc..b9028f5 100644 --- a/src/commands/generated/coupon_set.ts +++ b/src/commands/generated/coupon_set.ts @@ -25,15 +25,16 @@ export function registerCouponSet(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon-set add-coupon-codes\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_coupon_codes_to_coupon_set", opIdV1: "add_coupon_codes_to_coupon_set", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_coupon_codes_to_coupon_set", opIdV1: "add_coupon_codes_to_coupon_set", method: "POST", uri: "/coupon_sets/{id}/add_coupon_codes", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-set-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-set-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon-set add-coupon-codes", opts.yes === true); + await ensureWriteAllowed("POST", "coupon-set add-coupon-codes", opts); try { const client = await getClient(); const result = await (client as any).couponSet.addCouponCodes(resource.id, params); @@ -48,13 +49,14 @@ export function registerCouponSet(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon-set create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_coupon_set", opIdV1: "create_a_coupon_set", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_coupon_set", opIdV1: "create_a_coupon_set", method: "POST", uri: "/coupon_sets", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "coupon-set create", opts.yes === true); + await ensureWriteAllowed("POST", "coupon-set create", opts); try { const client = await getClient(); const result = await (client as any).couponSet.create(params); @@ -70,15 +72,16 @@ export function registerCouponSet(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon-set delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_coupon_set", opIdV1: "delete_a_coupon_set", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_coupon_set", opIdV1: "delete_a_coupon_set", method: "POST", uri: "/coupon_sets/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-set-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-set-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon-set delete", opts.yes === true); + await ensureWriteAllowed("POST", "coupon-set delete", opts); try { const client = await getClient(); const result = await (client as any).couponSet.delete(resource.id, params); @@ -94,15 +97,16 @@ export function registerCouponSet(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon-set delete-unused-coupon-codes\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_unused_coupon_codes", opIdV1: "delete_unused_coupon_codes", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_unused_coupon_codes", opIdV1: "delete_unused_coupon_codes", method: "POST", uri: "/coupon_sets/{id}/delete_unused_coupon_codes", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-set-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-set-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon-set delete-unused-coupon-codes", opts.yes === true); + await ensureWriteAllowed("POST", "coupon-set delete-unused-coupon-codes", opts); try { const client = await getClient(); const result = await (client as any).couponSet.deleteUnusedCouponCodes(resource.id, params); @@ -162,15 +166,16 @@ export function registerCouponSet(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs coupon-set update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_coupon_set", opIdV1: "update_a_coupon_set", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_coupon_set", opIdV1: "update_a_coupon_set", method: "POST", uri: "/coupon_sets/{id}/update", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "coupon-set-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'coupon-set-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "coupon-set update", opts.yes === true); + await ensureWriteAllowed("POST", "coupon-set update", opts); try { const client = await getClient(); const result = await (client as any).couponSet.update(resource.id, params); diff --git a/src/commands/generated/credit_note.ts b/src/commands/generated/credit_note.ts index 9968a21..6035ac1 100644 --- a/src/commands/generated/credit_note.ts +++ b/src/commands/generated/credit_note.ts @@ -24,13 +24,14 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_credit_note", opIdV1: "create_credit_note", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_credit_note", opIdV1: "create_credit_note", method: "POST", uri: "/credit_notes", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "credit-note create", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note create", opts); try { const client = await getClient(); const result = await (client as any).creditNote.create(params); @@ -68,15 +69,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_credit_note", opIdV1: "delete_a_credit_note", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_credit_note", opIdV1: "delete_a_credit_note", method: "POST", uri: "/credit_notes/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note delete", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note delete", opts); try { const client = await getClient(); const result = await (client as any).creditNote.delete(resource.id, params); @@ -113,13 +115,14 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note import-credit-note\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "import_credit_note", opIdV1: "import_credit_note", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "import_credit_note", opIdV1: "import_credit_note", method: "POST", uri: "/credit_notes/import_credit_note", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "credit-note import-credit-note", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note import-credit-note", opts); try { const client = await getClient(); const result = await (client as any).creditNote.importCreditNote(params); @@ -179,15 +182,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note record-refund\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "record_refund_for_a_credit_note", opIdV1: "record_refund_for_a_credit_note", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "record_refund_for_a_credit_note", opIdV1: "record_refund_for_a_credit_note", method: "POST", uri: "/credit_notes/{id}/record_refund", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note record-refund", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note record-refund", opts); try { const client = await getClient(); const result = await (client as any).creditNote.recordRefund(resource.id, params); @@ -203,15 +207,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note refund\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "refund_a_credit_note", opIdV1: "refund_a_credit_note", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "refund_a_credit_note", opIdV1: "refund_a_credit_note", method: "POST", uri: "/credit_notes/{id}/refund", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note refund", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note refund", opts); try { const client = await getClient(); const result = await (client as any).creditNote.refund(resource.id, params); @@ -227,15 +232,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note remove-tax-withheld-refund\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_tax_withheld_refunds_from_a_credit_note", opIdV1: "remove_tax_withheld_refunds_from_a_credit_note", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_tax_withheld_refunds_from_a_credit_note", opIdV1: "remove_tax_withheld_refunds_from_a_credit_note", method: "POST", uri: "/credit_notes/{id}/remove_tax_withheld_refund", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note remove-tax-withheld-refund", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note remove-tax-withheld-refund", opts); try { const client = await getClient(); const result = await (client as any).creditNote.removeTaxWithheldRefund(resource.id, params); @@ -251,15 +257,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note resend-einvoice\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "resend_failed_einvoice_in_credit_notes", opIdV1: "resend_failed_einvoice_in_credit_notes", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "resend_failed_einvoice_in_credit_notes", opIdV1: "resend_failed_einvoice_in_credit_notes", method: "POST", uri: "/credit_notes/{id}/resend_einvoice", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note resend-einvoice", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note resend-einvoice", opts); try { const client = await getClient(); const result = await (client as any).creditNote.resendEinvoice(resource.id, params); @@ -297,15 +304,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note send-einvoice\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "send_an_einvoice_for_credit_notes", opIdV1: "send_an_einvoice_for_credit_notes", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "send_an_einvoice_for_credit_notes", opIdV1: "send_an_einvoice_for_credit_notes", method: "POST", uri: "/credit_notes/{id}/send_einvoice", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note send-einvoice", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note send-einvoice", opts); try { const client = await getClient(); const result = await (client as any).creditNote.sendEinvoice(resource.id, params); @@ -321,15 +329,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note send-email\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "send_credit_note_email", opIdV1: "send_credit_note_email", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "send_credit_note_email", opIdV1: "send_credit_note_email", method: "POST", uri: "/credit_notes/{id}/send_email", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note send-email", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note send-email", opts); try { const client = await getClient(); const result = await (client as any).creditNote.sendEmail(resource.id, params); @@ -345,15 +354,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_credit_note_details", opIdV1: "update_credit_note_details", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_credit_note_details", opIdV1: "update_credit_note_details", method: "POST", uri: "/credit_notes/{id}/update", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note update", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note update", opts); try { const client = await getClient(); const result = await (client as any).creditNote.update(resource.id, params); @@ -369,15 +379,16 @@ export function registerCreditNote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-note void-credit-note\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "void_a_credit_note", opIdV1: "void_a_credit_note", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "void_a_credit_note", opIdV1: "void_a_credit_note", method: "POST", uri: "/credit_notes/{id}/void", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-note-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-note-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-note void-credit-note", opts.yes === true); + await ensureWriteAllowed("POST", "credit-note void-credit-note", opts); try { const client = await getClient(); const result = await (client as any).creditNote.voidCreditNote(resource.id, params); diff --git a/src/commands/generated/credit_unit.ts b/src/commands/generated/credit_unit.ts index 7c54a10..0b45b10 100644 --- a/src/commands/generated/credit_unit.ts +++ b/src/commands/generated/credit_unit.ts @@ -25,16 +25,17 @@ export function registerCreditUnit(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-unit archive\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "archive_a_credit_unit", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "credit-unit archive"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "archive_a_credit_unit", opIdV1: "", method: "POST", uri: "/credit_units/{id}/archive_command", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-unit-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-unit-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-unit archive", opts.yes === true); + await ensureWriteAllowed("POST", "credit-unit archive", opts); try { const client = await getClient(); const result = await (client as any).creditUnit.archive(resource.id, params); @@ -49,14 +50,15 @@ export function registerCreditUnit(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-unit create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_credit_unit", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "credit-unit create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_credit_unit", opIdV1: "", method: "POST", uri: "/credit_units", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "credit-unit create", opts.yes === true); + await ensureWriteAllowed("POST", "credit-unit create", opts); try { const client = await getClient(); const result = await (client as any).creditUnit.create(params); @@ -95,16 +97,17 @@ export function registerCreditUnit(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-unit reactivate\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "reactivate_a_credit_unit", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "credit-unit reactivate"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "reactivate_a_credit_unit", opIdV1: "", method: "POST", uri: "/credit_units/{id}/reactivate_command", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-unit-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-unit-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-unit reactivate", opts.yes === true); + await ensureWriteAllowed("POST", "credit-unit reactivate", opts); try { const client = await getClient(); const result = await (client as any).creditUnit.reactivate(resource.id, params); @@ -120,16 +123,17 @@ export function registerCreditUnit(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs credit-unit update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_credit_unit", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "credit-unit update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_credit_unit", opIdV1: "", method: "POST", uri: "/credit_units/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "credit-unit-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'credit-unit-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "credit-unit update", opts.yes === true); + await ensureWriteAllowed("POST", "credit-unit update", opts); try { const client = await getClient(); const result = await (client as any).creditUnit.update(resource.id, params); diff --git a/src/commands/generated/currency.ts b/src/commands/generated/currency.ts index eba52e6..74eb8ce 100644 --- a/src/commands/generated/currency.ts +++ b/src/commands/generated/currency.ts @@ -24,15 +24,16 @@ export function registerCurrency(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs currency add-schedule\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_schedule", opIdV1: "add_schedule", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_schedule", opIdV1: "add_schedule", method: "POST", uri: "/currencies/{id}/add_schedule", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "site-currency-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'site-currency-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "currency add-schedule", opts.yes === true); + await ensureWriteAllowed("POST", "currency add-schedule", opts); try { const client = await getClient(); const result = await (client as any).currency.addSchedule(resource.id, params); @@ -47,13 +48,14 @@ export function registerCurrency(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs currency create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_a_new_currency", opIdV1: "add_a_new_currency", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_a_new_currency", opIdV1: "add_a_new_currency", method: "POST", uri: "/currencies", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "currency create", opts.yes === true); + await ensureWriteAllowed("POST", "currency create", opts); try { const client = await getClient(); const result = await (client as any).currency.create(params); @@ -91,15 +93,16 @@ export function registerCurrency(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs currency remove-schedule\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_schedule", opIdV1: "remove_schedule", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_schedule", opIdV1: "remove_schedule", method: "POST", uri: "/currencies/{id}/remove_schedule", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "site-currency-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'site-currency-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "currency remove-schedule", opts.yes === true); + await ensureWriteAllowed("POST", "currency remove-schedule", opts); try { const client = await getClient(); const result = await (client as any).currency.removeSchedule(resource.id, params); @@ -137,15 +140,16 @@ export function registerCurrency(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs currency update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_currency", opIdV1: "update_a_currency", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_currency", opIdV1: "update_a_currency", method: "POST", uri: "/currencies/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "site-currency-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'site-currency-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "currency update", opts.yes === true); + await ensureWriteAllowed("POST", "currency update", opts); try { const client = await getClient(); const result = await (client as any).currency.update(resource.id, params); diff --git a/src/commands/generated/customer.ts b/src/commands/generated/customer.ts index 005b8f2..4cb212b 100644 --- a/src/commands/generated/customer.ts +++ b/src/commands/generated/customer.ts @@ -24,15 +24,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer add-contact\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_contacts_to_a_customer", opIdV1: "add_contacts_to_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_contacts_to_a_customer", opIdV1: "add_contacts_to_a_customer", method: "POST", uri: "/customers/{id}/add_contact", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer add-contact", opts.yes === true); + await ensureWriteAllowed("POST", "customer add-contact", opts); try { const client = await getClient(); const result = await (client as any).customer.addContact(resource.id, params); @@ -48,15 +49,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer add-promotional-credits\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/customers/{id}/add_promotional_credits", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: undefined, pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer add-promotional-credits", opts.yes === true); + await ensureWriteAllowed("POST", "customer add-promotional-credits", opts); try { const client = await getClient(); const result = await (client as any).customer.addPromotionalCredits(resource.id, params); @@ -72,15 +74,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer assign-payment-role\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "assign_payment_role", opIdV1: "assign_payment_role", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "assign_payment_role", opIdV1: "assign_payment_role", method: "POST", uri: "/customers/{id}/assign_payment_role", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer assign-payment-role", opts.yes === true); + await ensureWriteAllowed("POST", "customer assign-payment-role", opts); try { const client = await getClient(); const result = await (client as any).customer.assignPaymentRole(resource.id, params); @@ -96,15 +99,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer change-billing-date\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "change_billing_date", opIdV1: "change_billing_date", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "change_billing_date", opIdV1: "change_billing_date", method: "POST", uri: "/customers/{id}/change_billing_date", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer change-billing-date", opts.yes === true); + await ensureWriteAllowed("POST", "customer change-billing-date", opts); try { const client = await getClient(); const result = await (client as any).customer.changeBillingDate(resource.id, params); @@ -120,15 +124,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer clear-personal-data\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "clear_personal_data_of_a_customer", opIdV1: "clear_personal_data_of_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "clear_personal_data_of_a_customer", opIdV1: "clear_personal_data_of_a_customer", method: "POST", uri: "/customers/{id}/clear_personal_data", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer clear-personal-data", opts.yes === true); + await ensureWriteAllowed("POST", "customer clear-personal-data", opts); try { const client = await getClient(); const result = await (client as any).customer.clearPersonalData(resource.id, params); @@ -144,15 +149,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer collect-payment\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "collect_payment_for_customer", opIdV1: "collect_payment_for_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "collect_payment_for_customer", opIdV1: "collect_payment_for_customer", method: "POST", uri: "/customers/{id}/collect_payment", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer collect-payment", opts.yes === true); + await ensureWriteAllowed("POST", "customer collect-payment", opts); try { const client = await getClient(); const result = await (client as any).customer.collectPayment(resource.id, params); @@ -189,13 +195,14 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_customer", opIdV1: "create_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_customer", opIdV1: "create_a_customer", method: "POST", uri: "/customers", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "customer create", opts.yes === true); + await ensureWriteAllowed("POST", "customer create", opts); try { const client = await getClient(); const result = await (client as any).customer.create(params); @@ -211,15 +218,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer deduct-promotional-credits\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/customers/{id}/deduct_promotional_credits", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: undefined, pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer deduct-promotional-credits", opts.yes === true); + await ensureWriteAllowed("POST", "customer deduct-promotional-credits", opts); try { const client = await getClient(); const result = await (client as any).customer.deductPromotionalCredits(resource.id, params); @@ -235,15 +243,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_customer", opIdV1: "delete_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_customer", opIdV1: "delete_a_customer", method: "POST", uri: "/customers/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer delete", opts.yes === true); + await ensureWriteAllowed("POST", "customer delete", opts); try { const client = await getClient(); const result = await (client as any).customer.delete(resource.id, params); @@ -259,15 +268,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer delete-contact\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_contacts_for_a_customer", opIdV1: "delete_contacts_for_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_contacts_for_a_customer", opIdV1: "delete_contacts_for_a_customer", method: "POST", uri: "/customers/{id}/delete_contact", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer delete-contact", opts.yes === true); + await ensureWriteAllowed("POST", "customer delete-contact", opts); try { const client = await getClient(); const result = await (client as any).customer.deleteContact(resource.id, params); @@ -283,15 +293,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer delete-relationship\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delink_a_customer", opIdV1: "delink_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delink_a_customer", opIdV1: "delink_a_customer", method: "POST", uri: "/customers/{id}/delete_relationship", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer delete-relationship", opts.yes === true); + await ensureWriteAllowed("POST", "customer delete-relationship", opts); try { const client = await getClient(); const result = await (client as any).customer.deleteRelationship(resource.id, params); @@ -372,13 +383,14 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer merge\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "merge_customers", opIdV1: "merge_customers", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "merge_customers", opIdV1: "merge_customers", method: "POST", uri: "/customers/merge", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "customer merge", opts.yes === true); + await ensureWriteAllowed("POST", "customer merge", opts); try { const client = await getClient(); const result = await (client as any).customer.merge(params); @@ -393,13 +405,14 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer move\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "move_a_customer", opIdV1: "move_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "move_a_customer", opIdV1: "move_a_customer", method: "POST", uri: "/customers/move", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "customer move", opts.yes === true); + await ensureWriteAllowed("POST", "customer move", opts); try { const client = await getClient(); const result = await (client as any).customer.move(params); @@ -415,15 +428,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer record-excess-payment\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "record_an_excess_payment_for_a_customer", opIdV1: "record_an_excess_payment_for_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "record_an_excess_payment_for_a_customer", opIdV1: "record_an_excess_payment_for_a_customer", method: "POST", uri: "/customers/{id}/record_excess_payment", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer record-excess-payment", opts.yes === true); + await ensureWriteAllowed("POST", "customer record-excess-payment", opts); try { const client = await getClient(); const result = await (client as any).customer.recordExcessPayment(resource.id, params); @@ -439,15 +453,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer relationships\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "link_a_customer", opIdV1: "link_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "link_a_customer", opIdV1: "link_a_customer", method: "POST", uri: "/customers/{id}/relationships", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer relationships", opts.yes === true); + await ensureWriteAllowed("POST", "customer relationships", opts); try { const client = await getClient(); const result = await (client as any).customer.relationships(resource.id, params); @@ -485,15 +500,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer send-payment-request\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "send_payment_request_email", opIdV1: "send_payment_request_email", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "send_payment_request_email", opIdV1: "send_payment_request_email", method: "POST", uri: "/customers/{id}/send_payment_request", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer send-payment-request", opts.yes === true); + await ensureWriteAllowed("POST", "customer send-payment-request", opts); try { const client = await getClient(); const result = await (client as any).customer.sendPaymentRequest(resource.id, params); @@ -509,15 +525,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer set-promotional-credits\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/customers/{id}/set_promotional_credits", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: undefined, pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer set-promotional-credits", opts.yes === true); + await ensureWriteAllowed("POST", "customer set-promotional-credits", opts); try { const client = await getClient(); const result = await (client as any).customer.setPromotionalCredits(resource.id, params); @@ -533,15 +550,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_customer", opIdV1: "update_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_customer", opIdV1: "update_a_customer", method: "POST", uri: "/customers/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer update", opts.yes === true); + await ensureWriteAllowed("POST", "customer update", opts); try { const client = await getClient(); const result = await (client as any).customer.update(resource.id, params); @@ -557,15 +575,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer update-billing-info\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_billing_info_for_a_customer", opIdV1: "update_billing_info_for_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_billing_info_for_a_customer", opIdV1: "update_billing_info_for_a_customer", method: "POST", uri: "/customers/{id}/update_billing_info", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer update-billing-info", opts.yes === true); + await ensureWriteAllowed("POST", "customer update-billing-info", opts); try { const client = await getClient(); const result = await (client as any).customer.updateBillingInfo(resource.id, params); @@ -581,15 +600,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer update-contact\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_contacts_for_a_customer", opIdV1: "update_contacts_for_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_contacts_for_a_customer", opIdV1: "update_contacts_for_a_customer", method: "POST", uri: "/customers/{id}/update_contact", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer update-contact", opts.yes === true); + await ensureWriteAllowed("POST", "customer update-contact", opts); try { const client = await getClient(); const result = await (client as any).customer.updateContact(resource.id, params); @@ -605,15 +625,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer update-hierarchy-settings\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_hierarchy_access_settings_for_a_customer", opIdV1: "update_hierarchy_access_settings_for_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_hierarchy_access_settings_for_a_customer", opIdV1: "update_hierarchy_access_settings_for_a_customer", method: "POST", uri: "/customers/{id}/update_hierarchy_settings", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer update-hierarchy-settings", opts.yes === true); + await ensureWriteAllowed("POST", "customer update-hierarchy-settings", opts); try { const client = await getClient(); const result = await (client as any).customer.updateHierarchySettings(resource.id, params); @@ -629,15 +650,16 @@ export function registerCustomer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs customer update-payment-method\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_payment_method_for_a_customer", opIdV1: "update_payment_method_for_a_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_payment_method_for_a_customer", opIdV1: "update_payment_method_for_a_customer", method: "POST", uri: "/customers/{id}/update_payment_method", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "customer update-payment-method", opts.yes === true); + await ensureWriteAllowed("POST", "customer update-payment-method", opts); try { const client = await getClient(); const result = await (client as any).customer.updatePaymentMethod(resource.id, params); diff --git a/src/commands/generated/differential_price.ts b/src/commands/generated/differential_price.ts index 59fe680..7cfd416 100644 --- a/src/commands/generated/differential_price.ts +++ b/src/commands/generated/differential_price.ts @@ -25,16 +25,17 @@ export function registerDifferentialPrice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs differential-price create\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_differential_price", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "differential-price create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_differential_price", opIdV1: "", method: "POST", uri: "/item_prices/{id}/differential_prices", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-price-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-price-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "differential-price create", opts.yes === true); + await ensureWriteAllowed("POST", "differential-price create", opts); try { const client = await getClient(); const result = await (client as any).differentialPrice.create(resource.id, params); @@ -50,16 +51,17 @@ export function registerDifferentialPrice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs differential-price delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_differential_price", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "differential-price delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_differential_price", opIdV1: "", method: "POST", uri: "/differential_prices/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "differential-price-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'differential-price-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "differential-price delete", opts.yes === true); + await ensureWriteAllowed("POST", "differential-price delete", opts); try { const client = await getClient(); const result = await (client as any).differentialPrice.delete(resource.id, params); @@ -121,16 +123,17 @@ export function registerDifferentialPrice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs differential-price update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_differential_price", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "differential-price update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_differential_price", opIdV1: "", method: "POST", uri: "/differential_prices/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "differential-price-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'differential-price-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "differential-price update", opts.yes === true); + await ensureWriteAllowed("POST", "differential-price update", opts); try { const client = await getClient(); const result = await (client as any).differentialPrice.update(resource.id, params); diff --git a/src/commands/generated/entitlement.ts b/src/commands/generated/entitlement.ts index efa0032..1940c7c 100644 --- a/src/commands/generated/entitlement.ts +++ b/src/commands/generated/entitlement.ts @@ -23,14 +23,15 @@ export function registerEntitlement(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs entitlement create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "upsert_or_remove_entitlements_for_a_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "entitlement create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "upsert_or_remove_entitlements_for_a_feature", opIdV1: "", method: "POST", uri: "/entitlements", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "entitlement create", opts.yes === true); + await ensureWriteAllowed("POST", "entitlement create", opts); try { const client = await getClient(); const result = await (client as any).entitlement.create(params); diff --git a/src/commands/generated/entitlement_override.ts b/src/commands/generated/entitlement_override.ts index c09f5a4..3f7c949 100644 --- a/src/commands/generated/entitlement_override.ts +++ b/src/commands/generated/entitlement_override.ts @@ -24,16 +24,17 @@ export function registerEntitlementOverride(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs entitlement-override add-entitlement-override-for-subscription\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "upsert_or_remove_entitlement_overrides_for_a_subscription", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "entitlement-override add-entitlement-override-for-subscription"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "upsert_or_remove_entitlement_overrides_for_a_subscription", opIdV1: "", method: "POST", uri: "/subscriptions/{id}/entitlement_overrides", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "entitlement-override add-entitlement-override-for-subscription", opts.yes === true); + await ensureWriteAllowed("POST", "entitlement-override add-entitlement-override-for-subscription", opts); try { const client = await getClient(); const result = await (client as any).entitlementOverride.addEntitlementOverrideForSubscription(resource.id, params); diff --git a/src/commands/generated/feature.ts b/src/commands/generated/feature.ts index 23cf514..e582d0f 100644 --- a/src/commands/generated/feature.ts +++ b/src/commands/generated/feature.ts @@ -24,16 +24,17 @@ export function registerFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs feature activate\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "activate_a_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "feature activate"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "activate_a_feature", opIdV1: "", method: "POST", uri: "/features/{id}/activate_command", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "feature activate", opts.yes === true); + await ensureWriteAllowed("POST", "feature activate", opts); try { const client = await getClient(); const result = await (client as any).feature.activate(resource.id, params); @@ -49,16 +50,17 @@ export function registerFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs feature archive\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "archive_a_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "feature archive"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "archive_a_feature", opIdV1: "", method: "POST", uri: "/features/{id}/archive_command", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "feature archive", opts.yes === true); + await ensureWriteAllowed("POST", "feature archive", opts); try { const client = await getClient(); const result = await (client as any).feature.archive(resource.id, params); @@ -73,14 +75,15 @@ export function registerFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs feature create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "feature create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_feature", opIdV1: "", method: "POST", uri: "/features", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "feature create", opts.yes === true); + await ensureWriteAllowed("POST", "feature create", opts); try { const client = await getClient(); const result = await (client as any).feature.create(params); @@ -96,16 +99,17 @@ export function registerFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs feature delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "feature delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_feature", opIdV1: "", method: "POST", uri: "/features/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "feature delete", opts.yes === true); + await ensureWriteAllowed("POST", "feature delete", opts); try { const client = await getClient(); const result = await (client as any).feature.delete(resource.id, params); @@ -144,16 +148,17 @@ export function registerFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs feature reactivate\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "reactivate_a_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "feature reactivate"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "reactivate_a_feature", opIdV1: "", method: "POST", uri: "/features/{id}/reactivate_command", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "feature reactivate", opts.yes === true); + await ensureWriteAllowed("POST", "feature reactivate", opts); try { const client = await getClient(); const result = await (client as any).feature.reactivate(resource.id, params); @@ -192,16 +197,17 @@ export function registerFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs feature update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "feature update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_feature", opIdV1: "", method: "POST", uri: "/features/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "feature update", opts.yes === true); + await ensureWriteAllowed("POST", "feature update", opts); try { const client = await getClient(); const result = await (client as any).feature.update(resource.id, params); diff --git a/src/commands/generated/gift.ts b/src/commands/generated/gift.ts index 18765c3..a0f9ecd 100644 --- a/src/commands/generated/gift.ts +++ b/src/commands/generated/gift.ts @@ -24,15 +24,16 @@ export function registerGift(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs gift cancel\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "cancel_a_gift", opIdV1: "cancel_a_gift", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "cancel_a_gift", opIdV1: "cancel_a_gift", method: "POST", uri: "/gifts/{id}/cancel", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "gift-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'gift-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "gift cancel", opts.yes === true); + await ensureWriteAllowed("POST", "gift cancel", opts); try { const client = await getClient(); const result = await (client as any).gift.cancel(resource.id, params); @@ -48,15 +49,16 @@ export function registerGift(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs gift claim\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "claim_a_gift", opIdV1: "claim_a_gift", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "claim_a_gift", opIdV1: "claim_a_gift", method: "POST", uri: "/gifts/{id}/claim", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "gift-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'gift-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "gift claim", opts.yes === true); + await ensureWriteAllowed("POST", "gift claim", opts); try { const client = await getClient(); const result = await (client as any).gift.claim(resource.id, params); @@ -71,14 +73,15 @@ export function registerGift(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs gift create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_a_gift", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "gift create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_a_gift", method: "POST", uri: "/gifts", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "gift create", opts.yes === true); + await ensureWriteAllowed("POST", "gift create", opts); try { const client = await getClient(); const result = await (client as any).gift.create(params); @@ -93,14 +96,15 @@ export function registerGift(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs gift create-for-items\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_gift_subscription_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "gift create-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_gift_subscription_for_items", opIdV1: "", method: "POST", uri: "/gifts/create_for_items", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "gift create-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "gift create-for-items", opts); try { const client = await getClient(); const result = await (client as any).gift.createForItems(params); @@ -160,15 +164,16 @@ export function registerGift(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs gift update-gift\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_gift", opIdV1: "update_a_gift", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_gift", opIdV1: "update_a_gift", method: "POST", uri: "/gifts/{id}/update_gift", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "gift-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'gift-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "gift update-gift", opts.yes === true); + await ensureWriteAllowed("POST", "gift update-gift", opts); try { const client = await getClient(); const result = await (client as any).gift.updateGift(resource.id, params); diff --git a/src/commands/generated/hosted_page.ts b/src/commands/generated/hosted_page.ts index 2c6c5d2..aee02a8 100644 --- a/src/commands/generated/hosted_page.ts +++ b/src/commands/generated/hosted_page.ts @@ -44,15 +44,16 @@ export function registerHostedPage(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs hosted-page acknowledge\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "acknowledge_a_hosted_page", opIdV1: "acknowledge_a_hosted_page", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "acknowledge_a_hosted_page", opIdV1: "acknowledge_a_hosted_page", method: "POST", uri: "/hosted_pages/{id}/acknowledge", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "hosted-page-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'hosted-page-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "hosted-page acknowledge", opts.yes === true); + await ensureWriteAllowed("POST", "hosted-page acknowledge", opts); try { const client = await getClient(); const result = await (client as any).hostedPage.acknowledge(resource.id, params); @@ -265,13 +266,14 @@ export function registerHostedPage(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs hosted-page events\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "notify_an_event", opIdV1: "notify_an_event", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "notify_an_event", opIdV1: "notify_an_event", method: "POST", uri: "/hosted_pages/events", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "hosted-page events", opts.yes === true); + await ensureWriteAllowed("POST", "hosted-page events", opts); try { const client = await getClient(); const result = await (client as any).hostedPage.events(params); diff --git a/src/commands/generated/in_app_subscription.ts b/src/commands/generated/in_app_subscription.ts index d50d56d..b817ce5 100644 --- a/src/commands/generated/in_app_subscription.ts +++ b/src/commands/generated/in_app_subscription.ts @@ -22,15 +22,16 @@ export function registerInAppSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs in-app-subscription import-receipt\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "import_receipt", opIdV1: "import_receipt", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "import_receipt", opIdV1: "import_receipt", method: "POST", uri: "/in_app_subscriptions/{id}/import_receipt", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "in-app-subscription-app-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'in-app-subscription-app-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "in-app-subscription import-receipt", opts.yes === true); + await ensureWriteAllowed("POST", "in-app-subscription import-receipt", opts); try { const client = await getClient(); const result = await (client as any).inAppSubscription.importReceipt(resource.id, params); @@ -46,15 +47,16 @@ export function registerInAppSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs in-app-subscription import-subscription\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "import_subscription_without_receipt", opIdV1: "import_subscription_without_receipt", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "import_subscription_without_receipt", opIdV1: "import_subscription_without_receipt", method: "POST", uri: "/in_app_subscriptions/{id}/import_subscription", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "in-app-subscription-app-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'in-app-subscription-app-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "in-app-subscription import-subscription", opts.yes === true); + await ensureWriteAllowed("POST", "in-app-subscription import-subscription", opts); try { const client = await getClient(); const result = await (client as any).inAppSubscription.importSubscription(resource.id, params); @@ -70,15 +72,16 @@ export function registerInAppSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs in-app-subscription process-receipt\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "process_purchase_command", opIdV1: "process_purchase_command", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "process_purchase_command", opIdV1: "process_purchase_command", method: "POST", uri: "/in_app_subscriptions/{id}/process_purchase_command", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "in-app-subscription-app-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'in-app-subscription-app-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "in-app-subscription process-receipt", opts.yes === true); + await ensureWriteAllowed("POST", "in-app-subscription process-receipt", opts); try { const client = await getClient(); const result = await (client as any).inAppSubscription.processReceipt(resource.id, params); diff --git a/src/commands/generated/invoice.ts b/src/commands/generated/invoice.ts index b4acaa8..c80c9e2 100644 --- a/src/commands/generated/invoice.ts +++ b/src/commands/generated/invoice.ts @@ -24,16 +24,17 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice add-addon-charge\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "add_non-recurring_addon_to_a_pending_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "invoice add-addon-charge"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "add_non-recurring_addon_to_a_pending_invoice", method: "POST", uri: "/invoices/{id}/add_addon_charge", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice add-addon-charge", opts.yes === true); + await ensureWriteAllowed("POST", "invoice add-addon-charge", opts); try { const client = await getClient(); const result = await (client as any).invoice.addAddonCharge(resource.id, params); @@ -49,15 +50,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice add-charge\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_one-time_charge_to_a_pending_invoice", opIdV1: "add_one-time_charge_to_a_pending_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_one-time_charge_to_a_pending_invoice", opIdV1: "add_one-time_charge_to_a_pending_invoice", method: "POST", uri: "/invoices/{id}/add_charge", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice add-charge", opts.yes === true); + await ensureWriteAllowed("POST", "invoice add-charge", opts); try { const client = await getClient(); const result = await (client as any).invoice.addCharge(resource.id, params); @@ -73,16 +75,17 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice add-charge-item\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_a_charge-item_to_a_pending_invoice", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "invoice add-charge-item"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_a_charge-item_to_a_pending_invoice", opIdV1: "", method: "POST", uri: "/invoices/{id}/add_charge_item", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice add-charge-item", opts.yes === true); + await ensureWriteAllowed("POST", "invoice add-charge-item", opts); try { const client = await getClient(); const result = await (client as any).invoice.addChargeItem(resource.id, params); @@ -98,15 +101,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice apply-credits\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "apply_credits_for_an_invoice", opIdV1: "apply_credits_for_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "apply_credits_for_an_invoice", opIdV1: "apply_credits_for_an_invoice", method: "POST", uri: "/invoices/{id}/apply_credits", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice apply-credits", opts.yes === true); + await ensureWriteAllowed("POST", "invoice apply-credits", opts); try { const client = await getClient(); const result = await (client as any).invoice.applyCredits(resource.id, params); @@ -122,15 +126,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice apply-payments\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "apply_payments_for_an_invoice", opIdV1: "apply_payments_for_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "apply_payments_for_an_invoice", opIdV1: "apply_payments_for_an_invoice", method: "POST", uri: "/invoices/{id}/apply_payments", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice apply-payments", opts.yes === true); + await ensureWriteAllowed("POST", "invoice apply-payments", opts); try { const client = await getClient(); const result = await (client as any).invoice.applyPayments(resource.id, params); @@ -146,16 +151,17 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice apply-payment-schedule-scheme\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "apply_payment_schedule_scheme_to_an_invoice", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "invoice apply-payment-schedule-scheme"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "apply_payment_schedule_scheme_to_an_invoice", opIdV1: "", method: "POST", uri: "/invoices/{id}/apply_payment_schedule_scheme", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice apply-payment-schedule-scheme", opts.yes === true); + await ensureWriteAllowed("POST", "invoice apply-payment-schedule-scheme", opts); try { const client = await getClient(); const result = await (client as any).invoice.applyPaymentScheduleScheme(resource.id, params); @@ -170,14 +176,15 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice charge\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_invoice_for_a_one-time_charge", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "invoice charge"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_invoice_for_a_one-time_charge", method: "POST", uri: "/invoices/charge", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "invoice charge", opts.yes === true); + await ensureWriteAllowed("POST", "invoice charge", opts); try { const client = await getClient(); const result = await (client as any).invoice.charge(params); @@ -192,14 +199,15 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice charge-addon\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_invoice_for_a_non-recurring_addon", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "invoice charge-addon"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_invoice_for_a_non-recurring_addon", method: "POST", uri: "/invoices/charge_addon", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "invoice charge-addon", opts.yes === true); + await ensureWriteAllowed("POST", "invoice charge-addon", opts); try { const client = await getClient(); const result = await (client as any).invoice.chargeAddon(params); @@ -215,15 +223,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice close\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "close_a_pending_invoice", opIdV1: "close_a_pending_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "close_a_pending_invoice", opIdV1: "close_a_pending_invoice", method: "POST", uri: "/invoices/{id}/close", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice close", opts.yes === true); + await ensureWriteAllowed("POST", "invoice close", opts); try { const client = await getClient(); const result = await (client as any).invoice.close(resource.id, params); @@ -239,15 +248,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice collect-payment\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "collect_payment_for_an_invoice", opIdV1: "collect_payment_for_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "collect_payment_for_an_invoice", opIdV1: "collect_payment_for_an_invoice", method: "POST", uri: "/invoices/{id}/collect_payment", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice collect-payment", opts.yes === true); + await ensureWriteAllowed("POST", "invoice collect-payment", opts); try { const client = await getClient(); const result = await (client as any).invoice.collectPayment(resource.id, params); @@ -262,14 +272,15 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "invoice create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_an_invoice", method: "POST", uri: "/invoices", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "invoice create", opts.yes === true); + await ensureWriteAllowed("POST", "invoice create", opts); try { const client = await getClient(); const result = await (client as any).invoice.create(params); @@ -284,13 +295,14 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice create-for-charge-item\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/invoices/create_for_charge_item", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "invoice create-for-charge-item", opts.yes === true); + await ensureWriteAllowed("POST", "invoice create-for-charge-item", opts); try { const client = await getClient(); const result = await (client as any).invoice.createForChargeItem(params); @@ -305,14 +317,15 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice create-for-charge-items-and-charges\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_invoice_for_items_and_one-time_charges", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "invoice create-for-charge-items-and-charges"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_invoice_for_items_and_one-time_charges", opIdV1: "", method: "POST", uri: "/invoices/create_for_charge_items_and_charges", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "invoice create-for-charge-items-and-charges", opts.yes === true); + await ensureWriteAllowed("POST", "invoice create-for-charge-items-and-charges", opts); try { const client = await getClient(); const result = await (client as any).invoice.createForChargeItemsAndCharges(params); @@ -328,15 +341,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_invoice", opIdV1: "delete_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_invoice", opIdV1: "delete_an_invoice", method: "POST", uri: "/invoices/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice delete", opts.yes === true); + await ensureWriteAllowed("POST", "invoice delete", opts); try { const client = await getClient(); const result = await (client as any).invoice.delete(resource.id, params); @@ -352,15 +366,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice delete-line-items\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_line_items", opIdV1: "delete_line_items", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_line_items", opIdV1: "delete_line_items", method: "POST", uri: "/invoices/{id}/delete_line_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice delete-line-items", opts.yes === true); + await ensureWriteAllowed("POST", "invoice delete-line-items", opts); try { const client = await getClient(); const result = await (client as any).invoice.deleteLineItems(resource.id, params); @@ -397,13 +412,14 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice import-invoice\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "import_invoice", opIdV1: "import_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "import_invoice", opIdV1: "import_invoice", method: "POST", uri: "/invoices/import_invoice", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "invoice import-invoice", opts.yes === true); + await ensureWriteAllowed("POST", "invoice import-invoice", opts); try { const client = await getClient(); const result = await (client as any).invoice.importInvoice(params); @@ -504,15 +520,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice pause-dunning\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "pause_dunning_for_invoice", opIdV1: "pause_dunning_for_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "pause_dunning_for_invoice", opIdV1: "pause_dunning_for_invoice", method: "POST", uri: "/invoices/{id}/pause_dunning", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice pause-dunning", opts.yes === true); + await ensureWriteAllowed("POST", "invoice pause-dunning", opts); try { const client = await getClient(); const result = await (client as any).invoice.pauseDunning(resource.id, params); @@ -573,15 +590,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice record-payment\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "record_an_invoice_payment", opIdV1: "record_an_invoice_payment", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "record_an_invoice_payment", opIdV1: "record_an_invoice_payment", method: "POST", uri: "/invoices/{id}/record_payment", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice record-payment", opts.yes === true); + await ensureWriteAllowed("POST", "invoice record-payment", opts); try { const client = await getClient(); const result = await (client as any).invoice.recordPayment(resource.id, params); @@ -597,15 +615,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice record-refund\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "record_refund_for_an_invoice", opIdV1: "record_refund_for_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "record_refund_for_an_invoice", opIdV1: "record_refund_for_an_invoice", method: "POST", uri: "/invoices/{id}/record_refund", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice record-refund", opts.yes === true); + await ensureWriteAllowed("POST", "invoice record-refund", opts); try { const client = await getClient(); const result = await (client as any).invoice.recordRefund(resource.id, params); @@ -621,15 +640,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice record-tax-withheld\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "record_tax_withheld_for_an_invoice", opIdV1: "record_tax_withheld_for_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "record_tax_withheld_for_an_invoice", opIdV1: "record_tax_withheld_for_an_invoice", method: "POST", uri: "/invoices/{id}/record_tax_withheld", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice record-tax-withheld", opts.yes === true); + await ensureWriteAllowed("POST", "invoice record-tax-withheld", opts); try { const client = await getClient(); const result = await (client as any).invoice.recordTaxWithheld(resource.id, params); @@ -645,15 +665,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice refund\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "refund_an_invoice", opIdV1: "refund_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "refund_an_invoice", opIdV1: "refund_an_invoice", method: "POST", uri: "/invoices/{id}/refund", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice refund", opts.yes === true); + await ensureWriteAllowed("POST", "invoice refund", opts); try { const client = await getClient(); const result = await (client as any).invoice.refund(resource.id, params); @@ -669,15 +690,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice remove-credit-note\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_credit_note_from_an_invoice", opIdV1: "remove_credit_note_from_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_credit_note_from_an_invoice", opIdV1: "remove_credit_note_from_an_invoice", method: "POST", uri: "/invoices/{id}/remove_credit_note", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice remove-credit-note", opts.yes === true); + await ensureWriteAllowed("POST", "invoice remove-credit-note", opts); try { const client = await getClient(); const result = await (client as any).invoice.removeCreditNote(resource.id, params); @@ -693,15 +715,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice remove-payment\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_payment_from_an_invoice", opIdV1: "remove_payment_from_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_payment_from_an_invoice", opIdV1: "remove_payment_from_an_invoice", method: "POST", uri: "/invoices/{id}/remove_payment", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice remove-payment", opts.yes === true); + await ensureWriteAllowed("POST", "invoice remove-payment", opts); try { const client = await getClient(); const result = await (client as any).invoice.removePayment(resource.id, params); @@ -717,16 +740,17 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice remove-payment-schedule-scheme\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_payment_schedule_scheme_from_an_invoice", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "invoice remove-payment-schedule-scheme"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_payment_schedule_scheme_from_an_invoice", opIdV1: "", method: "POST", uri: "/invoices/{id}/remove_payment_schedule_scheme", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice remove-payment-schedule-scheme", opts.yes === true); + await ensureWriteAllowed("POST", "invoice remove-payment-schedule-scheme", opts); try { const client = await getClient(); const result = await (client as any).invoice.removePaymentScheduleScheme(resource.id, params); @@ -742,15 +766,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice remove-tax-withheld\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_tax_withheld_for_an_invoice", opIdV1: "remove_tax_withheld_for_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_tax_withheld_for_an_invoice", opIdV1: "remove_tax_withheld_for_an_invoice", method: "POST", uri: "/invoices/{id}/remove_tax_withheld", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice remove-tax-withheld", opts.yes === true); + await ensureWriteAllowed("POST", "invoice remove-tax-withheld", opts); try { const client = await getClient(); const result = await (client as any).invoice.removeTaxWithheld(resource.id, params); @@ -766,15 +791,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice resend-einvoice\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "resend_failed_einvoice_in_invoices", opIdV1: "resend_failed_einvoice_in_invoices", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "resend_failed_einvoice_in_invoices", opIdV1: "resend_failed_einvoice_in_invoices", method: "POST", uri: "/invoices/{id}/resend_einvoice", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice resend-einvoice", opts.yes === true); + await ensureWriteAllowed("POST", "invoice resend-einvoice", opts); try { const client = await getClient(); const result = await (client as any).invoice.resendEinvoice(resource.id, params); @@ -790,15 +816,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice resume-dunning\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "resume_dunning_for_invoice", opIdV1: "resume_dunning_for_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "resume_dunning_for_invoice", opIdV1: "resume_dunning_for_invoice", method: "POST", uri: "/invoices/{id}/resume_dunning", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice resume-dunning", opts.yes === true); + await ensureWriteAllowed("POST", "invoice resume-dunning", opts); try { const client = await getClient(); const result = await (client as any).invoice.resumeDunning(resource.id, params); @@ -836,15 +863,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice send-einvoice\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "send_an_einvoice_for_invoices", opIdV1: "send_an_einvoice_for_invoices", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "send_an_einvoice_for_invoices", opIdV1: "send_an_einvoice_for_invoices", method: "POST", uri: "/invoices/{id}/send_einvoice", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice send-einvoice", opts.yes === true); + await ensureWriteAllowed("POST", "invoice send-einvoice", opts); try { const client = await getClient(); const result = await (client as any).invoice.sendEinvoice(resource.id, params); @@ -860,15 +888,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice send-email\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "send_invoice_email", opIdV1: "send_invoice_email", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "send_invoice_email", opIdV1: "send_invoice_email", method: "POST", uri: "/invoices/{id}/send_email", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice send-email", opts.yes === true); + await ensureWriteAllowed("POST", "invoice send-email", opts); try { const client = await getClient(); const result = await (client as any).invoice.sendEmail(resource.id, params); @@ -884,15 +913,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice stop-dunning\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "stop_dunning_for_invoice", opIdV1: "stop_dunning_for_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "stop_dunning_for_invoice", opIdV1: "stop_dunning_for_invoice", method: "POST", uri: "/invoices/{id}/stop_dunning", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice stop-dunning", opts.yes === true); + await ensureWriteAllowed("POST", "invoice stop-dunning", opts); try { const client = await getClient(); const result = await (client as any).invoice.stopDunning(resource.id, params); @@ -908,15 +938,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice sync-usages\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "sync_usages", opIdV1: "sync_usages", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "sync_usages", opIdV1: "sync_usages", method: "POST", uri: "/invoices/{id}/sync_usages", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice sync-usages", opts.yes === true); + await ensureWriteAllowed("POST", "invoice sync-usages", opts); try { const client = await getClient(); const result = await (client as any).invoice.syncUsages(resource.id, params); @@ -932,15 +963,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice update-details\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_invoice_details", opIdV1: "update_invoice_details", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_invoice_details", opIdV1: "update_invoice_details", method: "POST", uri: "/invoices/{id}/update_details", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice update-details", opts.yes === true); + await ensureWriteAllowed("POST", "invoice update-details", opts); try { const client = await getClient(); const result = await (client as any).invoice.updateDetails(resource.id, params); @@ -956,15 +988,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice void-before-capture\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "void_authorizations_before_capture", opIdV1: "void_authorizations_before_capture", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "void_authorizations_before_capture", opIdV1: "void_authorizations_before_capture", method: "POST", uri: "/invoices/{id}/void_before_capture", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice void-before-capture", opts.yes === true); + await ensureWriteAllowed("POST", "invoice void-before-capture", opts); try { const client = await getClient(); const result = await (client as any).invoice.voidBeforeCapture(resource.id, params); @@ -980,15 +1013,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice void-invoice\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "void_an_invoice", opIdV1: "void_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "void_an_invoice", opIdV1: "void_an_invoice", method: "POST", uri: "/invoices/{id}/void", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice void-invoice", opts.yes === true); + await ensureWriteAllowed("POST", "invoice void-invoice", opts); try { const client = await getClient(); const result = await (client as any).invoice.voidInvoice(resource.id, params); @@ -1004,15 +1038,16 @@ export function registerInvoice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs invoice write-off\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "write_off_an_invoice", opIdV1: "write_off_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "write_off_an_invoice", opIdV1: "write_off_an_invoice", method: "POST", uri: "/invoices/{id}/write_off", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "invoice-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'invoice-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "invoice write-off", opts.yes === true); + await ensureWriteAllowed("POST", "invoice write-off", opts); try { const client = await getClient(); const result = await (client as any).invoice.writeOff(resource.id, params); diff --git a/src/commands/generated/item.ts b/src/commands/generated/item.ts index 0c28115..687660b 100644 --- a/src/commands/generated/item.ts +++ b/src/commands/generated/item.ts @@ -23,14 +23,15 @@ export function registerItem(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_item", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_item", opIdV1: "", method: "POST", uri: "/items", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "item create", opts.yes === true); + await ensureWriteAllowed("POST", "item create", opts); try { const client = await getClient(); const result = await (client as any).item.create(params); @@ -46,16 +47,17 @@ export function registerItem(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_item", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_item", opIdV1: "", method: "POST", uri: "/items/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "item delete", opts.yes === true); + await ensureWriteAllowed("POST", "item delete", opts); try { const client = await getClient(); const result = await (client as any).item.delete(resource.id, params); @@ -117,16 +119,17 @@ export function registerItem(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_an_item", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_an_item", opIdV1: "", method: "POST", uri: "/items/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "item update", opts.yes === true); + await ensureWriteAllowed("POST", "item update", opts); try { const client = await getClient(); const result = await (client as any).item.update(resource.id, params); diff --git a/src/commands/generated/item_entitlement.ts b/src/commands/generated/item_entitlement.ts index 5186700..f402f1e 100644 --- a/src/commands/generated/item_entitlement.ts +++ b/src/commands/generated/item_entitlement.ts @@ -24,16 +24,17 @@ export function registerItemEntitlement(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item-entitlement add-item-entitlements\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "upsert_or_remove_item_entitlements_for_a_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item-entitlement add-item-entitlements"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "upsert_or_remove_item_entitlements_for_a_feature", opIdV1: "", method: "POST", uri: "/features/{id}/item_entitlements", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "item-entitlement add-item-entitlements", opts.yes === true); + await ensureWriteAllowed("POST", "item-entitlement add-item-entitlements", opts); try { const client = await getClient(); const result = await (client as any).itemEntitlement.addItemEntitlements(resource.id, params); @@ -95,16 +96,17 @@ export function registerItemEntitlement(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item-entitlement upsert-or-remove-item-entitlements-for-item\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "upsert_or_remove_item_entitlements_for_an_item", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item-entitlement upsert-or-remove-item-entitlements-for-item"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "upsert_or_remove_item_entitlements_for_an_item", opIdV1: "", method: "POST", uri: "/items/{id}/item_entitlements", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "item-entitlement upsert-or-remove-item-entitlements-for-item", opts.yes === true); + await ensureWriteAllowed("POST", "item-entitlement upsert-or-remove-item-entitlements-for-item", opts); try { const client = await getClient(); const result = await (client as any).itemEntitlement.upsertOrRemoveItemEntitlementsForItem(resource.id, params); diff --git a/src/commands/generated/item_family.ts b/src/commands/generated/item_family.ts index 9d430a8..0e27208 100644 --- a/src/commands/generated/item_family.ts +++ b/src/commands/generated/item_family.ts @@ -24,14 +24,15 @@ export function registerItemFamily(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item-family create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_item_family", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item-family create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_item_family", opIdV1: "", method: "POST", uri: "/item_families", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "item-family create", opts.yes === true); + await ensureWriteAllowed("POST", "item-family create", opts); try { const client = await getClient(); const result = await (client as any).itemFamily.create(params); @@ -47,16 +48,17 @@ export function registerItemFamily(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item-family delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_item_family", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item-family delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_item_family", opIdV1: "", method: "POST", uri: "/item_families/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-family-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-family-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "item-family delete", opts.yes === true); + await ensureWriteAllowed("POST", "item-family delete", opts); try { const client = await getClient(); const result = await (client as any).itemFamily.delete(resource.id, params); @@ -118,16 +120,17 @@ export function registerItemFamily(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item-family update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_an_item_family", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item-family update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_an_item_family", opIdV1: "", method: "POST", uri: "/item_families/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-family-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-family-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "item-family update", opts.yes === true); + await ensureWriteAllowed("POST", "item-family update", opts); try { const client = await getClient(); const result = await (client as any).itemFamily.update(resource.id, params); diff --git a/src/commands/generated/item_price.ts b/src/commands/generated/item_price.ts index 46c52b0..fe90797 100644 --- a/src/commands/generated/item_price.ts +++ b/src/commands/generated/item_price.ts @@ -24,14 +24,15 @@ export function registerItemPrice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item-price create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_item_price", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item-price create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_item_price", opIdV1: "", method: "POST", uri: "/item_prices", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "item-price create", opts.yes === true); + await ensureWriteAllowed("POST", "item-price create", opts); try { const client = await getClient(); const result = await (client as any).itemPrice.create(params); @@ -47,16 +48,17 @@ export function registerItemPrice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item-price delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_item_price", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item-price delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_item_price", opIdV1: "", method: "POST", uri: "/item_prices/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-price-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-price-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "item-price delete", opts.yes === true); + await ensureWriteAllowed("POST", "item-price delete", opts); try { const client = await getClient(); const result = await (client as any).itemPrice.delete(resource.id, params); @@ -164,16 +166,17 @@ export function registerItemPrice(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs item-price update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_an_item_price", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "item-price update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_an_item_price", opIdV1: "", method: "POST", uri: "/item_prices/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "item-price-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'item-price-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "item-price update", opts.yes === true); + await ensureWriteAllowed("POST", "item-price update", opts); try { const client = await getClient(); const result = await (client as any).itemPrice.update(resource.id, params); diff --git a/src/commands/generated/ledger_account_balance.ts b/src/commands/generated/ledger_account_balance.ts index f95a624..a58ec91 100644 --- a/src/commands/generated/ledger_account_balance.ts +++ b/src/commands/generated/ledger_account_balance.ts @@ -43,14 +43,15 @@ export function registerLedgerAccountBalance(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ledger-account-balance update-overdraft-limit\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_overdraft_limit", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ledger-account-balance update-overdraft-limit"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_overdraft_limit", opIdV1: "", method: "POST", uri: "/ledger_account_balances/update_overdraft_limit", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "ledger-account-balance update-overdraft-limit", opts.yes === true); + await ensureWriteAllowed("POST", "ledger-account-balance update-overdraft-limit", opts); try { const client = await getClient(); const result = await (client as any).ledgerAccountBalance.updateOverdraftLimit(params); diff --git a/src/commands/generated/ledger_operation.ts b/src/commands/generated/ledger_operation.ts index b7c6171..af27aef 100644 --- a/src/commands/generated/ledger_operation.ts +++ b/src/commands/generated/ledger_operation.ts @@ -23,14 +23,15 @@ export function registerLedgerOperation(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ledger-operation allocate\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "allocate", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ledger-operation allocate"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "allocate", opIdV1: "", method: "POST", uri: "/ledger_operations/allocate", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "ledger-operation allocate", opts.yes === true); + await ensureWriteAllowed("POST", "ledger-operation allocate", opts); try { const client = await getClient(); const result = await (client as any).ledgerOperation.allocate(params); @@ -45,14 +46,15 @@ export function registerLedgerOperation(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ledger-operation authorize\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "authorize", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ledger-operation authorize"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "authorize", opIdV1: "", method: "POST", uri: "/ledger_operations/authorize", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "ledger-operation authorize", opts.yes === true); + await ensureWriteAllowed("POST", "ledger-operation authorize", opts); try { const client = await getClient(); const result = await (client as any).ledgerOperation.authorize(params); @@ -67,14 +69,15 @@ export function registerLedgerOperation(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ledger-operation capture\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "capture", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ledger-operation capture"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "capture", opIdV1: "", method: "POST", uri: "/ledger_operations/capture", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "ledger-operation capture", opts.yes === true); + await ensureWriteAllowed("POST", "ledger-operation capture", opts); try { const client = await getClient(); const result = await (client as any).ledgerOperation.capture(params); @@ -89,14 +92,15 @@ export function registerLedgerOperation(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ledger-operation capture-authorization\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "capture_authorization", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ledger-operation capture-authorization"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "capture_authorization", opIdV1: "", method: "POST", uri: "/ledger_operations/capture_authorization", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "ledger-operation capture-authorization", opts.yes === true); + await ensureWriteAllowed("POST", "ledger-operation capture-authorization", opts); try { const client = await getClient(); const result = await (client as any).ledgerOperation.captureAuthorization(params); @@ -131,14 +135,15 @@ export function registerLedgerOperation(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ledger-operation release-authorization\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "release_authorization", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ledger-operation release-authorization"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "release_authorization", opIdV1: "", method: "POST", uri: "/ledger_operations/release_authorization", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "ledger-operation release-authorization", opts.yes === true); + await ensureWriteAllowed("POST", "ledger-operation release-authorization", opts); try { const client = await getClient(); const result = await (client as any).ledgerOperation.releaseAuthorization(params); diff --git a/src/commands/generated/metered_feature.ts b/src/commands/generated/metered_feature.ts index f494d85..9059af2 100644 --- a/src/commands/generated/metered_feature.ts +++ b/src/commands/generated/metered_feature.ts @@ -22,16 +22,17 @@ export function registerMeteredFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs metered-feature archive\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "archive_a_metered_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "metered-feature archive"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "archive_a_metered_feature", opIdV1: "", method: "POST", uri: "/metered_features/{id}/archive_command", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "metered-feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'metered-feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "metered-feature archive", opts.yes === true); + await ensureWriteAllowed("POST", "metered-feature archive", opts); try { const client = await getClient(); const result = await (client as any).meteredFeature.archive(resource.id, params); @@ -46,14 +47,15 @@ export function registerMeteredFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs metered-feature create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_metered_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "metered-feature create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_metered_feature", opIdV1: "", method: "POST", uri: "/metered_features", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "metered-feature create", opts.yes === true); + await ensureWriteAllowed("POST", "metered-feature create", opts); try { const client = await getClient(); const result = await (client as any).meteredFeature.create(params); @@ -69,16 +71,17 @@ export function registerMeteredFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs metered-feature delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_metered_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "metered-feature delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_metered_feature", opIdV1: "", method: "POST", uri: "/metered_features/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "metered-feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'metered-feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "metered-feature delete", opts.yes === true); + await ensureWriteAllowed("POST", "metered-feature delete", opts); try { const client = await getClient(); const result = await (client as any).meteredFeature.delete(resource.id, params); @@ -94,16 +97,17 @@ export function registerMeteredFeature(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs metered-feature reactivate\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "reactivate_a_metered_feature", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "metered-feature reactivate"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "reactivate_a_metered_feature", opIdV1: "", method: "POST", uri: "/metered_features/{id}/reactivate_command", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "metered-feature-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'metered-feature-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "metered-feature reactivate", opts.yes === true); + await ensureWriteAllowed("POST", "metered-feature reactivate", opts); try { const client = await getClient(); const result = await (client as any).meteredFeature.reactivate(resource.id, params); diff --git a/src/commands/generated/non_subscription.ts b/src/commands/generated/non_subscription.ts index a38e3c8..2b84e2c 100644 --- a/src/commands/generated/non_subscription.ts +++ b/src/commands/generated/non_subscription.ts @@ -22,15 +22,16 @@ export function registerNonSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs non-subscription process-receipt\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/non_subscriptions/{id}/one_time_purchase", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "non-subscription-app-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'non-subscription-app-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "non-subscription process-receipt", opts.yes === true); + await ensureWriteAllowed("POST", "non-subscription process-receipt", opts); try { const client = await getClient(); const result = await (client as any).nonSubscription.processReceipt(resource.id, params); diff --git a/src/commands/generated/offer_event.ts b/src/commands/generated/offer_event.ts index 1b10fc0..67210a5 100644 --- a/src/commands/generated/offer_event.ts +++ b/src/commands/generated/offer_event.ts @@ -21,13 +21,14 @@ export function registerOfferEvent(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs offer-event offer-events\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "create_an_offer_event", opIdV1: "create_an_offer_event", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_offer_event", opIdV1: "create_an_offer_event", method: "POST", uri: "/offer_events", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "offer-event offer-events", opts.yes === true); + await ensureWriteAllowed("POST", "offer-event offer-events", opts); try { const client = await getClient(); const result = await (client as any).offerEvent.offerEvents(params); diff --git a/src/commands/generated/offer_fulfillment.ts b/src/commands/generated/offer_fulfillment.ts index e6e315a..aa4807a 100644 --- a/src/commands/generated/offer_fulfillment.ts +++ b/src/commands/generated/offer_fulfillment.ts @@ -23,13 +23,14 @@ export function registerOfferFulfillment(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs offer-fulfillment offer-fulfillments\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "create_an_offer_fulfillment", opIdV1: "create_an_offer_fulfillment", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_offer_fulfillment", opIdV1: "create_an_offer_fulfillment", method: "POST", uri: "/offer_fulfillments", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "offer-fulfillment offer-fulfillments", opts.yes === true); + await ensureWriteAllowed("POST", "offer-fulfillment offer-fulfillments", opts); try { const client = await getClient(); const result = await (client as any).offerFulfillment.offerFulfillments(params); @@ -67,15 +68,16 @@ export function registerOfferFulfillment(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs offer-fulfillment offer-fulfillments-update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "update_an_offer_fulfillment", opIdV1: "update_an_offer_fulfillment", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_an_offer_fulfillment", opIdV1: "update_an_offer_fulfillment", method: "POST", uri: "/offer_fulfillments/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "offer-fulfillment-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'offer-fulfillment-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "offer-fulfillment offer-fulfillments-update", opts.yes === true); + await ensureWriteAllowed("POST", "offer-fulfillment offer-fulfillments-update", opts); try { const client = await getClient(); const result = await (client as any).offerFulfillment.offerFulfillmentsUpdate(resource.id, params); diff --git a/src/commands/generated/omnichannel_subscription.ts b/src/commands/generated/omnichannel_subscription.ts index 0945b37..6b02519 100644 --- a/src/commands/generated/omnichannel_subscription.ts +++ b/src/commands/generated/omnichannel_subscription.ts @@ -48,16 +48,17 @@ export function registerOmnichannelSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs omnichannel-subscription move\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "move_an_omnichannel_subscription", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "omnichannel-subscription move"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "move_an_omnichannel_subscription", opIdV1: "", method: "POST", uri: "/omnichannel_subscriptions/{id}/move", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "omnichannel-subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'omnichannel-subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "omnichannel-subscription move", opts.yes === true); + await ensureWriteAllowed("POST", "omnichannel-subscription move", opts); try { const client = await getClient(); const result = await (client as any).omnichannelSubscription.move(resource.id, params); diff --git a/src/commands/generated/order.ts b/src/commands/generated/order.ts index 2060221..23cd3ce 100644 --- a/src/commands/generated/order.ts +++ b/src/commands/generated/order.ts @@ -24,15 +24,16 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order assign-order-number\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "assign_order_number", opIdV1: "assign_order_number", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "assign_order_number", opIdV1: "assign_order_number", method: "POST", uri: "/orders/{id}/assign_order_number", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "order-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'order-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "order assign-order-number", opts.yes === true); + await ensureWriteAllowed("POST", "order assign-order-number", opts); try { const client = await getClient(); const result = await (client as any).order.assignOrderNumber(resource.id, params); @@ -48,15 +49,16 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order cancel\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "cancel_an_order", opIdV1: "cancel_an_order", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "cancel_an_order", opIdV1: "cancel_an_order", method: "POST", uri: "/orders/{id}/cancel", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "order-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'order-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "order cancel", opts.yes === true); + await ensureWriteAllowed("POST", "order cancel", opts); try { const client = await getClient(); const result = await (client as any).order.cancel(resource.id, params); @@ -71,13 +73,14 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_order", opIdV1: "create_an_order", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_order", opIdV1: "create_an_order", method: "POST", uri: "/orders", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "order create", opts.yes === true); + await ensureWriteAllowed("POST", "order create", opts); try { const client = await getClient(); const result = await (client as any).order.create(params); @@ -93,15 +96,16 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order create-refundable-credit-note\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_refundable_credit_note", opIdV1: "create_a_refundable_credit_note", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_refundable_credit_note", opIdV1: "create_a_refundable_credit_note", method: "POST", uri: "/orders/{id}/create_refundable_credit_note", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "order-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'order-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "order create-refundable-credit-note", opts.yes === true); + await ensureWriteAllowed("POST", "order create-refundable-credit-note", opts); try { const client = await getClient(); const result = await (client as any).order.createRefundableCreditNote(resource.id, params); @@ -117,15 +121,16 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_imported_order", opIdV1: "delete_an_imported_order", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_imported_order", opIdV1: "delete_an_imported_order", method: "POST", uri: "/orders/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "order-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'order-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "order delete", opts.yes === true); + await ensureWriteAllowed("POST", "order delete", opts); try { const client = await getClient(); const result = await (client as any).order.delete(resource.id, params); @@ -140,13 +145,14 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order import-order\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "import_an_order", opIdV1: "import_an_order", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "import_an_order", opIdV1: "import_an_order", method: "POST", uri: "/orders/import_order", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "order import-order", opts.yes === true); + await ensureWriteAllowed("POST", "order import-order", opts); try { const client = await getClient(); const result = await (client as any).order.importOrder(params); @@ -206,15 +212,16 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order reopen\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "reopen_a_cancelled_order", opIdV1: "reopen_a_cancelled_order", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "reopen_a_cancelled_order", opIdV1: "reopen_a_cancelled_order", method: "POST", uri: "/orders/{id}/reopen", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "order-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'order-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "order reopen", opts.yes === true); + await ensureWriteAllowed("POST", "order reopen", opts); try { const client = await getClient(); const result = await (client as any).order.reopen(resource.id, params); @@ -230,15 +237,16 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order resend\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "resend_an_order", opIdV1: "resend_an_order", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "resend_an_order", opIdV1: "resend_an_order", method: "POST", uri: "/orders/{id}/resend", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "order-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'order-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "order resend", opts.yes === true); + await ensureWriteAllowed("POST", "order resend", opts); try { const client = await getClient(); const result = await (client as any).order.resend(resource.id, params); @@ -276,15 +284,16 @@ export function registerOrder(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs order update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_an_order", opIdV1: "update_an_order", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_an_order", opIdV1: "update_an_order", method: "POST", uri: "/orders/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "order-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'order-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "order update", opts.yes === true); + await ensureWriteAllowed("POST", "order update", opts); try { const client = await getClient(); const result = await (client as any).order.update(resource.id, params); diff --git a/src/commands/generated/payment_intent.ts b/src/commands/generated/payment_intent.ts index a702a81..eccca0e 100644 --- a/src/commands/generated/payment_intent.ts +++ b/src/commands/generated/payment_intent.ts @@ -23,13 +23,14 @@ export function registerPaymentIntent(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-intent create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_payment_intent", opIdV1: "create_a_payment_intent", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_payment_intent", opIdV1: "create_a_payment_intent", method: "POST", uri: "/payment_intents", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-intent create", opts.yes === true); + await ensureWriteAllowed("POST", "payment-intent create", opts); try { const client = await getClient(); const result = await (client as any).paymentIntent.create(params); @@ -67,15 +68,16 @@ export function registerPaymentIntent(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-intent update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_payment_intent", opIdV1: "update_a_payment_intent", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_payment_intent", opIdV1: "update_a_payment_intent", method: "POST", uri: "/payment_intents/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "payment-intent-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'payment-intent-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-intent update", opts.yes === true); + await ensureWriteAllowed("POST", "payment-intent update", opts); try { const client = await getClient(); const result = await (client as any).paymentIntent.update(resource.id, params); diff --git a/src/commands/generated/payment_schedule_scheme.ts b/src/commands/generated/payment_schedule_scheme.ts index ee8c7cd..cf32f7f 100644 --- a/src/commands/generated/payment_schedule_scheme.ts +++ b/src/commands/generated/payment_schedule_scheme.ts @@ -24,14 +24,15 @@ export function registerPaymentScheduleScheme(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-schedule-scheme create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_payment_schedule_scheme", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "payment-schedule-scheme create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_payment_schedule_scheme", opIdV1: "", method: "POST", uri: "/payment_schedule_schemes", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-schedule-scheme create", opts.yes === true); + await ensureWriteAllowed("POST", "payment-schedule-scheme create", opts); try { const client = await getClient(); const result = await (client as any).paymentScheduleScheme.create(params); @@ -47,16 +48,17 @@ export function registerPaymentScheduleScheme(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-schedule-scheme delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_payment_schedule_scheme", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "payment-schedule-scheme delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_payment_schedule_scheme", opIdV1: "", method: "POST", uri: "/payment_schedule_schemes/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "payment-schedule-scheme-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'payment-schedule-scheme-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-schedule-scheme delete", opts.yes === true); + await ensureWriteAllowed("POST", "payment-schedule-scheme delete", opts); try { const client = await getClient(); const result = await (client as any).paymentScheduleScheme.delete(resource.id, params); diff --git a/src/commands/generated/payment_source.ts b/src/commands/generated/payment_source.ts index 5622e7d..f77e7fa 100644 --- a/src/commands/generated/payment_source.ts +++ b/src/commands/generated/payment_source.ts @@ -24,13 +24,14 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source create-bank-account\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_bank_account_payment_source", opIdV1: "create_a_bank_account_payment_source", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_bank_account_payment_source", opIdV1: "create_a_bank_account_payment_source", method: "POST", uri: "/payment_sources/create_bank_account", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-source create-bank-account", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source create-bank-account", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.createBankAccount(params); @@ -45,13 +46,14 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source create-card\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_card_payment_source", opIdV1: "create_a_card_payment_source", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_card_payment_source", opIdV1: "create_a_card_payment_source", method: "POST", uri: "/payment_sources/create_card", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-source create-card", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source create-card", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.createCard(params); @@ -66,13 +68,14 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source create-using-payment-intent\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_using_payment_intent", opIdV1: "create_using_payment_intent", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_using_payment_intent", opIdV1: "create_using_payment_intent", method: "POST", uri: "/payment_sources/create_using_payment_intent", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-source create-using-payment-intent", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source create-using-payment-intent", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.createUsingPaymentIntent(params); @@ -87,13 +90,14 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source create-using-permanent-token\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_using_permanent_token", opIdV1: "create_using_permanent_token", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_using_permanent_token", opIdV1: "create_using_permanent_token", method: "POST", uri: "/payment_sources/create_using_permanent_token", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-source create-using-permanent-token", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source create-using-permanent-token", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.createUsingPermanentToken(params); @@ -108,13 +112,14 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source create-using-temp-token\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_using_gateway_temporary_token", opIdV1: "create_using_gateway_temporary_token", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_using_gateway_temporary_token", opIdV1: "create_using_gateway_temporary_token", method: "POST", uri: "/payment_sources/create_using_temp_token", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-source create-using-temp-token", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source create-using-temp-token", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.createUsingTempToken(params); @@ -129,13 +134,14 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source create-using-token\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_using_chargebee_token", opIdV1: "create_using_chargebee_token", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_using_chargebee_token", opIdV1: "create_using_chargebee_token", method: "POST", uri: "/payment_sources/create_using_token", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-source create-using-token", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source create-using-token", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.createUsingToken(params); @@ -150,13 +156,14 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source create-voucher-payment-source\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_voucher_payment_method", opIdV1: "create_a_voucher_payment_method", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_voucher_payment_method", opIdV1: "create_a_voucher_payment_method", method: "POST", uri: "/payment_sources/create_voucher_payment_source", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-source create-voucher-payment-source", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source create-voucher-payment-source", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.createVoucherPaymentSource(params); @@ -172,15 +179,16 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_payment_source", opIdV1: "delete_a_payment_source", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_payment_source", opIdV1: "delete_a_payment_source", method: "POST", uri: "/payment_sources/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "cust-payment-source-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'cust-payment-source-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-source delete", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source delete", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.delete(resource.id, params); @@ -196,15 +204,16 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source delete-local\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "local_delete_a_payment_source", opIdV1: "local_delete_a_payment_source", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "local_delete_a_payment_source", opIdV1: "local_delete_a_payment_source", method: "POST", uri: "/payment_sources/{id}/delete_local", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "cust-payment-source-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'cust-payment-source-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-source delete-local", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source delete-local", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.deleteLocal(resource.id, params); @@ -220,15 +229,16 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source export-payment-source\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "export_payment_source", opIdV1: "export_payment_source", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "export_payment_source", opIdV1: "export_payment_source", method: "POST", uri: "/payment_sources/{id}/export_payment_source", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "cust-payment-source-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'cust-payment-source-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-source export-payment-source", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source export-payment-source", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.exportPaymentSource(resource.id, params); @@ -310,15 +320,16 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source switch-gateway-account\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "switch_gateway_account", opIdV1: "switch_gateway_account", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "switch_gateway_account", opIdV1: "switch_gateway_account", method: "POST", uri: "/payment_sources/{id}/switch_gateway_account", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "cust-payment-source-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'cust-payment-source-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-source switch-gateway-account", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source switch-gateway-account", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.switchGatewayAccount(resource.id, params); @@ -334,15 +345,16 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source update-bank-account\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_bank_account_payment_source", opIdV1: "update_a_bank_account_payment_source", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_bank_account_payment_source", opIdV1: "update_a_bank_account_payment_source", method: "POST", uri: "/payment_sources/{id}/update_bank_account", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "cust-payment-source-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'cust-payment-source-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-source update-bank-account", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source update-bank-account", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.updateBankAccount(resource.id, params); @@ -358,15 +370,16 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source update-card\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_card_payment_source", opIdV1: "update_a_card_payment_source", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_card_payment_source", opIdV1: "update_a_card_payment_source", method: "POST", uri: "/payment_sources/{id}/update_card", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "cust-payment-source-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'cust-payment-source-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-source update-card", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source update-card", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.updateCard(resource.id, params); @@ -382,15 +395,16 @@ export function registerPaymentSource(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-source verify-bank-account\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "verify_bank_account_payment_source", opIdV1: "verify_bank_account_payment_source", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "verify_bank_account_payment_source", opIdV1: "verify_bank_account_payment_source", method: "POST", uri: "/payment_sources/{id}/verify_bank_account", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "cust-payment-source-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'cust-payment-source-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "payment-source verify-bank-account", opts.yes === true); + await ensureWriteAllowed("POST", "payment-source verify-bank-account", opts); try { const client = await getClient(); const result = await (client as any).paymentSource.verifyBankAccount(resource.id, params); diff --git a/src/commands/generated/payment_voucher.ts b/src/commands/generated/payment_voucher.ts index 1449b37..e08388b 100644 --- a/src/commands/generated/payment_voucher.ts +++ b/src/commands/generated/payment_voucher.ts @@ -23,13 +23,14 @@ export function registerPaymentVoucher(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs payment-voucher create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_voucher_for_the_customer_to_initiate_payment", opIdV1: "create_a_voucher_for_the_customer_to_initiate_payment", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_voucher_for_the_customer_to_initiate_payment", opIdV1: "create_a_voucher_for_the_customer_to_initiate_payment", method: "POST", uri: "/payment_vouchers", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "payment-voucher create", opts.yes === true); + await ensureWriteAllowed("POST", "payment-voucher create", opts); try { const client = await getClient(); const result = await (client as any).paymentVoucher.create(params); diff --git a/src/commands/generated/personalized_offer.ts b/src/commands/generated/personalized_offer.ts index 75585ec..e37a168 100644 --- a/src/commands/generated/personalized_offer.ts +++ b/src/commands/generated/personalized_offer.ts @@ -21,13 +21,14 @@ export function registerPersonalizedOffer(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs personalized-offer personalized-offers\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "list_personalized_offers", opIdV1: "list_personalized_offers", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "list_personalized_offers", opIdV1: "list_personalized_offers", method: "POST", uri: "/personalized_offers", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "personalized-offer personalized-offers", opts.yes === true); + await ensureWriteAllowed("POST", "personalized-offer personalized-offers", opts); try { const client = await getClient(); const result = await (client as any).personalizedOffer.personalizedOffers(params); diff --git a/src/commands/generated/plan.ts b/src/commands/generated/plan.ts index f583f8c..5010ff6 100644 --- a/src/commands/generated/plan.ts +++ b/src/commands/generated/plan.ts @@ -23,14 +23,15 @@ export function registerPlan(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs plan copy\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "copy_a_plan", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "plan copy"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "copy_a_plan", method: "POST", uri: "/plans/copy", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "plan copy", opts.yes === true); + await ensureWriteAllowed("POST", "plan copy", opts); try { const client = await getClient(); const result = await (client as any).plan.copy(params); @@ -45,14 +46,15 @@ export function registerPlan(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs plan create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_a_plan", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "plan create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_a_plan", method: "POST", uri: "/plans", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "plan create", opts.yes === true); + await ensureWriteAllowed("POST", "plan create", opts); try { const client = await getClient(); const result = await (client as any).plan.create(params); @@ -68,16 +70,17 @@ export function registerPlan(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs plan delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "delete_a_plan", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "plan delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "delete_a_plan", method: "POST", uri: "/plans/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "plan-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'plan-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "plan delete", opts.yes === true); + await ensureWriteAllowed("POST", "plan delete", opts); try { const client = await getClient(); const result = await (client as any).plan.delete(resource.id, params); @@ -139,16 +142,17 @@ export function registerPlan(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs plan unarchive\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "unarchive_a_plan", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "plan unarchive"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "unarchive_a_plan", method: "POST", uri: "/plans/{id}/unarchive", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "plan-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'plan-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "plan unarchive", opts.yes === true); + await ensureWriteAllowed("POST", "plan unarchive", opts); try { const client = await getClient(); const result = await (client as any).plan.unarchive(resource.id, params); @@ -164,16 +168,17 @@ export function registerPlan(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs plan update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "update_a_plan", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "plan update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "update_a_plan", method: "POST", uri: "/plans/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "plan-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'plan-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "plan update", opts.yes === true); + await ensureWriteAllowed("POST", "plan update", opts); try { const client = await getClient(); const result = await (client as any).plan.update(resource.id, params); diff --git a/src/commands/generated/portal_session.ts b/src/commands/generated/portal_session.ts index 4ea394a..2b82036 100644 --- a/src/commands/generated/portal_session.ts +++ b/src/commands/generated/portal_session.ts @@ -24,15 +24,16 @@ export function registerPortalSession(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs portal-session activate\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "activate_a_portal_session", opIdV1: "activate_a_portal_session", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "activate_a_portal_session", opIdV1: "activate_a_portal_session", method: "POST", uri: "/portal_sessions/{id}/activate", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "portal-session-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'portal-session-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "portal-session activate", opts.yes === true); + await ensureWriteAllowed("POST", "portal-session activate", opts); try { const client = await getClient(); const result = await (client as any).portalSession.activate(resource.id, params); @@ -67,15 +68,16 @@ export function registerPortalSession(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs portal-session logout\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "logout_a_portal_session", opIdV1: "logout_a_portal_session", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "logout_a_portal_session", opIdV1: "logout_a_portal_session", method: "POST", uri: "/portal_sessions/{id}/logout", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "portal-session-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'portal-session-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "portal-session logout", opts.yes === true); + await ensureWriteAllowed("POST", "portal-session logout", opts); try { const client = await getClient(); const result = await (client as any).portalSession.logout(resource.id, params); diff --git a/src/commands/generated/price_ramp.ts b/src/commands/generated/price_ramp.ts index b396ce1..93a85e2 100644 --- a/src/commands/generated/price_ramp.ts +++ b/src/commands/generated/price_ramp.ts @@ -24,14 +24,15 @@ export function registerPriceRamp(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs price-ramp create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_price_ramp", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "price-ramp create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_price_ramp", opIdV1: "", method: "POST", uri: "/price_ramps", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "price-ramp create", opts.yes === true); + await ensureWriteAllowed("POST", "price-ramp create", opts); try { const client = await getClient(); const result = await (client as any).priceRamp.create(params); @@ -47,16 +48,17 @@ export function registerPriceRamp(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs price-ramp delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_price_ramp", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "price-ramp delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_price_ramp", opIdV1: "", method: "POST", uri: "/price_ramps/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "price-ramp-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'price-ramp-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "price-ramp delete", opts.yes === true); + await ensureWriteAllowed("POST", "price-ramp delete", opts); try { const client = await getClient(); const result = await (client as any).priceRamp.delete(resource.id, params); @@ -118,16 +120,17 @@ export function registerPriceRamp(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs price-ramp update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_price_ramp", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "price-ramp update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_price_ramp", opIdV1: "", method: "POST", uri: "/price_ramps/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "price-ramp-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'price-ramp-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "price-ramp update", opts.yes === true); + await ensureWriteAllowed("POST", "price-ramp update", opts); try { const client = await getClient(); const result = await (client as any).priceRamp.update(resource.id, params); diff --git a/src/commands/generated/price_variant.ts b/src/commands/generated/price_variant.ts index 57e55c4..4c12437 100644 --- a/src/commands/generated/price_variant.ts +++ b/src/commands/generated/price_variant.ts @@ -24,14 +24,15 @@ export function registerPriceVariant(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs price-variant create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_price_variant", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "price-variant create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_price_variant", opIdV1: "", method: "POST", uri: "/price_variants", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "price-variant create", opts.yes === true); + await ensureWriteAllowed("POST", "price-variant create", opts); try { const client = await getClient(); const result = await (client as any).priceVariant.create(params); @@ -47,16 +48,17 @@ export function registerPriceVariant(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs price-variant delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_price_variant", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "price-variant delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_price_variant", opIdV1: "", method: "POST", uri: "/price_variants/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "price-variant-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'price-variant-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "price-variant delete", opts.yes === true); + await ensureWriteAllowed("POST", "price-variant delete", opts); try { const client = await getClient(); const result = await (client as any).priceVariant.delete(resource.id, params); @@ -118,16 +120,17 @@ export function registerPriceVariant(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs price-variant update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_price_variant", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "price-variant update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_price_variant", opIdV1: "", method: "POST", uri: "/price_variants/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "price-variant-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'price-variant-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "price-variant update", opts.yes === true); + await ensureWriteAllowed("POST", "price-variant update", opts); try { const client = await getClient(); const result = await (client as any).priceVariant.update(resource.id, params); diff --git a/src/commands/generated/pricing_page_session.ts b/src/commands/generated/pricing_page_session.ts index d801b54..0ba856f 100644 --- a/src/commands/generated/pricing_page_session.ts +++ b/src/commands/generated/pricing_page_session.ts @@ -21,14 +21,15 @@ export function registerPricingPageSession(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs pricing-page-session create-for-existing-subscription\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_pricing_page_for_existing_subscription", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "pricing-page-session create-for-existing-subscription"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_pricing_page_for_existing_subscription", opIdV1: "", method: "POST", uri: "/pricing_page_sessions/create_for_existing_subscription", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "pricing-page-session create-for-existing-subscription", opts.yes === true); + await ensureWriteAllowed("POST", "pricing-page-session create-for-existing-subscription", opts); try { const client = await getClient(); const result = await (client as any).pricingPageSession.createForExistingSubscription(params); @@ -43,14 +44,15 @@ export function registerPricingPageSession(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs pricing-page-session create-for-new-subscription\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_pricing_page_for_new_subscription", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "pricing-page-session create-for-new-subscription"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_pricing_page_for_new_subscription", opIdV1: "", method: "POST", uri: "/pricing_page_sessions/create_for_new_subscription", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "pricing-page-session create-for-new-subscription", opts.yes === true); + await ensureWriteAllowed("POST", "pricing-page-session create-for-new-subscription", opts); try { const client = await getClient(); const result = await (client as any).pricingPageSession.createForNewSubscription(params); diff --git a/src/commands/generated/promotional_credit.ts b/src/commands/generated/promotional_credit.ts index b77758e..b292c63 100644 --- a/src/commands/generated/promotional_credit.ts +++ b/src/commands/generated/promotional_credit.ts @@ -24,13 +24,14 @@ export function registerPromotionalCredit(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs promotional-credit add\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_promotional_credits", opIdV1: "add_promotional_credits", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_promotional_credits", opIdV1: "add_promotional_credits", method: "POST", uri: "/promotional_credits/add", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "promotional-credit add", opts.yes === true); + await ensureWriteAllowed("POST", "promotional-credit add", opts); try { const client = await getClient(); const result = await (client as any).promotionalCredit.add(params); @@ -45,13 +46,14 @@ export function registerPromotionalCredit(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs promotional-credit deduct\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "deduct_promotional_credits", opIdV1: "deduct_promotional_credits", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "deduct_promotional_credits", opIdV1: "deduct_promotional_credits", method: "POST", uri: "/promotional_credits/deduct", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "promotional-credit deduct", opts.yes === true); + await ensureWriteAllowed("POST", "promotional-credit deduct", opts); try { const client = await getClient(); const result = await (client as any).promotionalCredit.deduct(params); @@ -110,13 +112,14 @@ export function registerPromotionalCredit(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs promotional-credit set\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "set_promotional_credits", opIdV1: "set_promotional_credits", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "set_promotional_credits", opIdV1: "set_promotional_credits", method: "POST", uri: "/promotional_credits/set", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "promotional-credit set", opts.yes === true); + await ensureWriteAllowed("POST", "promotional-credit set", opts); try { const client = await getClient(); const result = await (client as any).promotionalCredit.set(params); diff --git a/src/commands/generated/promotional_grant.ts b/src/commands/generated/promotional_grant.ts index 9732136..f978c80 100644 --- a/src/commands/generated/promotional_grant.ts +++ b/src/commands/generated/promotional_grant.ts @@ -21,14 +21,15 @@ export function registerPromotionalGrant(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs promotional-grant promotional-grants\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "create_promotional_grant", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "promotional-grant promotional-grants"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_promotional_grant", opIdV1: "", method: "POST", uri: "/promotional_grants", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "promotional-grant promotional-grants", opts.yes === true); + await ensureWriteAllowed("POST", "promotional-grant promotional-grants", opts); try { const client = await getClient(); const result = await (client as any).promotionalGrant.promotionalGrants(params); diff --git a/src/commands/generated/purchase.ts b/src/commands/generated/purchase.ts index 9d9a3b6..b69ad1d 100644 --- a/src/commands/generated/purchase.ts +++ b/src/commands/generated/purchase.ts @@ -20,14 +20,15 @@ export function registerPurchase(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs purchase create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_purchase", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "purchase create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_purchase", opIdV1: "", method: "POST", uri: "/purchases", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "purchase create", opts.yes === true); + await ensureWriteAllowed("POST", "purchase create", opts); try { const client = await getClient(); const result = await (client as any).purchase.create(params); @@ -42,14 +43,15 @@ export function registerPurchase(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs purchase estimate\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "estimates_for_purchase", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "purchase estimate"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "estimates_for_purchase", opIdV1: "", method: "POST", uri: "/purchases/estimate", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "purchase estimate", opts.yes === true); + await ensureWriteAllowed("POST", "purchase estimate", opts); try { const client = await getClient(); const result = await (client as any).purchase.estimate(params); diff --git a/src/commands/generated/quote.ts b/src/commands/generated/quote.ts index 657b7b8..2f7fce8 100644 --- a/src/commands/generated/quote.ts +++ b/src/commands/generated/quote.ts @@ -24,15 +24,16 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote convert\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "convert_a_quote", opIdV1: "convert_a_quote", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "convert_a_quote", opIdV1: "convert_a_quote", method: "POST", uri: "/quotes/{id}/convert", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote convert", opts.yes === true); + await ensureWriteAllowed("POST", "quote convert", opts); try { const client = await getClient(); const result = await (client as any).quote.convert(resource.id, params); @@ -47,14 +48,15 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote create-for-charge-items-and-charges\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_quote_for_charge_and_charge_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "quote create-for-charge-items-and-charges"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_quote_for_charge_and_charge_items", opIdV1: "", method: "POST", uri: "/quotes/create_for_charge_items_and_charges", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "quote create-for-charge-items-and-charges", opts.yes === true); + await ensureWriteAllowed("POST", "quote create-for-charge-items-and-charges", opts); try { const client = await getClient(); const result = await (client as any).quote.createForChargeItemsAndCharges(params); @@ -69,14 +71,15 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote create-for-onetime-charges\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_quote_for_one-time_charges", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "quote create-for-onetime-charges"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_quote_for_one-time_charges", method: "POST", uri: "/quotes/create_for_onetime_charges", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "quote create-for-onetime-charges", opts.yes === true); + await ensureWriteAllowed("POST", "quote create-for-onetime-charges", opts); try { const client = await getClient(); const result = await (client as any).quote.createForOnetimeCharges(params); @@ -92,15 +95,16 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote create-signature\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/quotes/{id}/create_signature", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: undefined, pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote create-signature", opts.yes === true); + await ensureWriteAllowed("POST", "quote create-signature", opts); try { const client = await getClient(); const result = await (client as any).quote.createSignature(resource.id, params); @@ -116,16 +120,17 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote create-sub-for-customer-quote\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_quote_for_a_new_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "quote create-sub-for-customer-quote"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_quote_for_a_new_subscription", method: "POST", uri: "/customers/{id}/create_subscription_quote", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote create-sub-for-customer-quote", opts.yes === true); + await ensureWriteAllowed("POST", "quote create-sub-for-customer-quote", opts); try { const client = await getClient(); const result = await (client as any).quote.createSubForCustomerQuote(resource.id, params); @@ -141,16 +146,17 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote create-sub-items-for-customer-quote\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_quote_for_a_new_subscription_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "quote create-sub-items-for-customer-quote"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_quote_for_a_new_subscription_items", opIdV1: "", method: "POST", uri: "/customers/{id}/create_subscription_quote_for_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote create-sub-items-for-customer-quote", opts.yes === true); + await ensureWriteAllowed("POST", "quote create-sub-items-for-customer-quote", opts); try { const client = await getClient(); const result = await (client as any).quote.createSubItemsForCustomerQuote(resource.id, params); @@ -166,15 +172,16 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_quote", opIdV1: "delete_a_quote", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_quote", opIdV1: "delete_a_quote", method: "POST", uri: "/quotes/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote delete", opts.yes === true); + await ensureWriteAllowed("POST", "quote delete", opts); try { const client = await getClient(); const result = await (client as any).quote.delete(resource.id, params); @@ -190,16 +197,17 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote edit-create-sub-customer-quote-for-items\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "edit_create_subscription_quote_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "quote edit-create-sub-customer-quote-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "edit_create_subscription_quote_for_items", opIdV1: "", method: "POST", uri: "/quotes/{id}/edit_create_subscription_quote_for_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote edit-create-sub-customer-quote-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "quote edit-create-sub-customer-quote-for-items", opts); try { const client = await getClient(); const result = await (client as any).quote.editCreateSubCustomerQuoteForItems(resource.id, params); @@ -215,16 +223,17 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote edit-create-sub-for-customer-quote\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "edit_quote_for_a_new_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "quote edit-create-sub-for-customer-quote"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "edit_quote_for_a_new_subscription", method: "POST", uri: "/quotes/{id}/edit_create_subscription_quote", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote edit-create-sub-for-customer-quote", opts.yes === true); + await ensureWriteAllowed("POST", "quote edit-create-sub-for-customer-quote", opts); try { const client = await getClient(); const result = await (client as any).quote.editCreateSubForCustomerQuote(resource.id, params); @@ -240,16 +249,17 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote edit-for-charge-items-and-charges\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "edit_quote_for_charge_items_and_charges", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "quote edit-for-charge-items-and-charges"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "edit_quote_for_charge_items_and_charges", opIdV1: "", method: "POST", uri: "/quotes/{id}/edit_for_charge_items_and_charges", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote edit-for-charge-items-and-charges", opts.yes === true); + await ensureWriteAllowed("POST", "quote edit-for-charge-items-and-charges", opts); try { const client = await getClient(); const result = await (client as any).quote.editForChargeItemsAndCharges(resource.id, params); @@ -265,16 +275,17 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote edit-one-time-quote\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "edit_quote_for_one-time_charges", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "quote edit-one-time-quote"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "edit_quote_for_one-time_charges", method: "POST", uri: "/quotes/{id}/edit_one_time_quote", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote edit-one-time-quote", opts.yes === true); + await ensureWriteAllowed("POST", "quote edit-one-time-quote", opts); try { const client = await getClient(); const result = await (client as any).quote.editOneTimeQuote(resource.id, params); @@ -290,16 +301,17 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote edit-update-subscription-quote\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "edit_quote_for_updating_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "quote edit-update-subscription-quote"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "edit_quote_for_updating_a_subscription", method: "POST", uri: "/quotes/{id}/edit_update_subscription_quote", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote edit-update-subscription-quote", opts.yes === true); + await ensureWriteAllowed("POST", "quote edit-update-subscription-quote", opts); try { const client = await getClient(); const result = await (client as any).quote.editUpdateSubscriptionQuote(resource.id, params); @@ -315,16 +327,17 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote edit-update-subscription-quote-for-items\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "edit_update_subscription_quote_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "quote edit-update-subscription-quote-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "edit_update_subscription_quote_for_items", opIdV1: "", method: "POST", uri: "/quotes/{id}/edit_update_subscription_quote_for_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote edit-update-subscription-quote-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "quote edit-update-subscription-quote-for-items", opts); try { const client = await getClient(); const result = await (client as any).quote.editUpdateSubscriptionQuoteForItems(resource.id, params); @@ -340,15 +353,16 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote extend-expiry-date\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "extend_expiry_date", opIdV1: "extend_expiry_date", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "extend_expiry_date", opIdV1: "extend_expiry_date", method: "POST", uri: "/quotes/{id}/extend_expiry_date", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote extend-expiry-date", opts.yes === true); + await ensureWriteAllowed("POST", "quote extend-expiry-date", opts); try { const client = await getClient(); const result = await (client as any).quote.extendExpiryDate(resource.id, params); @@ -430,15 +444,16 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote refresh-signature-link\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/quotes/{id}/refresh_signature_link", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: undefined, pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote refresh-signature-link", opts.yes === true); + await ensureWriteAllowed("POST", "quote refresh-signature-link", opts); try { const client = await getClient(); const result = await (client as any).quote.refreshSignatureLink(resource.id, params); @@ -520,15 +535,16 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote update-signature\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/quotes/{id}/update_signature", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: undefined, pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote update-signature", opts.yes === true); + await ensureWriteAllowed("POST", "quote update-signature", opts); try { const client = await getClient(); const result = await (client as any).quote.updateSignature(resource.id, params); @@ -544,15 +560,16 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote update-signature-status\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "", method: "POST", uri: "/quotes/{id}/update_signature_status", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: undefined, pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote update-signature-status", opts.yes === true); + await ensureWriteAllowed("POST", "quote update-signature-status", opts); try { const client = await getClient(); const result = await (client as any).quote.updateSignatureStatus(resource.id, params); @@ -568,15 +585,16 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote update-status\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_quote_status", opIdV1: "update_quote_status", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_quote_status", opIdV1: "update_quote_status", method: "POST", uri: "/quotes/{id}/update_status", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "quote-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'quote-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "quote update-status", opts.yes === true); + await ensureWriteAllowed("POST", "quote update-status", opts); try { const client = await getClient(); const result = await (client as any).quote.updateStatus(resource.id, params); @@ -591,14 +609,15 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote update-subscription-quote\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_quote_for_updating_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "quote update-subscription-quote"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_quote_for_updating_a_subscription", method: "POST", uri: "/quotes/update_subscription_quote", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "quote update-subscription-quote", opts.yes === true); + await ensureWriteAllowed("POST", "quote update-subscription-quote", opts); try { const client = await getClient(); const result = await (client as any).quote.updateSubscriptionQuote(params); @@ -613,14 +632,15 @@ export function registerQuote(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs quote update-subscription-quote-for-items\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_quote_for_update_subscription_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "quote update-subscription-quote-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_quote_for_update_subscription_items", opIdV1: "", method: "POST", uri: "/quotes/update_subscription_quote_for_items", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "quote update-subscription-quote-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "quote update-subscription-quote-for-items", opts); try { const client = await getClient(); const result = await (client as any).quote.updateSubscriptionQuoteForItems(params); diff --git a/src/commands/generated/ramp.ts b/src/commands/generated/ramp.ts index c052e31..7d395d2 100644 --- a/src/commands/generated/ramp.ts +++ b/src/commands/generated/ramp.ts @@ -24,16 +24,17 @@ export function registerRamp(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ramp create-for-subscription\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_ramp", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ramp create-for-subscription"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_ramp", opIdV1: "", method: "POST", uri: "/subscriptions/{id}/create_ramp", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "ramp create-for-subscription", opts.yes === true); + await ensureWriteAllowed("POST", "ramp create-for-subscription", opts); try { const client = await getClient(); const result = await (client as any).ramp.createForSubscription(resource.id, params); @@ -49,16 +50,17 @@ export function registerRamp(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ramp delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_ramp", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ramp delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_ramp", opIdV1: "", method: "POST", uri: "/ramps/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "ramp-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'ramp-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "ramp delete", opts.yes === true); + await ensureWriteAllowed("POST", "ramp delete", opts); try { const client = await getClient(); const result = await (client as any).ramp.delete(resource.id, params); @@ -120,16 +122,17 @@ export function registerRamp(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs ramp update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_subscription_ramp", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "ramp update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_subscription_ramp", opIdV1: "", method: "POST", uri: "/ramps/{id}/update", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "ramp-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'ramp-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "ramp update", opts.yes === true); + await ensureWriteAllowed("POST", "ramp update", opts); try { const client = await getClient(); const result = await (client as any).ramp.update(resource.id, params); diff --git a/src/commands/generated/recorded_purchase.ts b/src/commands/generated/recorded_purchase.ts index 2dcaf5c..8effbcd 100644 --- a/src/commands/generated/recorded_purchase.ts +++ b/src/commands/generated/recorded_purchase.ts @@ -23,14 +23,15 @@ export function registerRecordedPurchase(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs recorded-purchase create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "record_a_purchase", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "recorded-purchase create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "record_a_purchase", opIdV1: "", method: "POST", uri: "/recorded_purchases", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "recorded-purchase create", opts.yes === true); + await ensureWriteAllowed("POST", "recorded-purchase create", opts); try { const client = await getClient(); const result = await (client as any).recordedPurchase.create(params); diff --git a/src/commands/generated/subscription.ts b/src/commands/generated/subscription.ts index 3e845fb..610908e 100644 --- a/src/commands/generated/subscription.ts +++ b/src/commands/generated/subscription.ts @@ -24,15 +24,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription add-charge-at-term-end\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "add_charge_at_term_end", opIdV1: "add_charge_at_term_end", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "add_charge_at_term_end", opIdV1: "add_charge_at_term_end", method: "POST", uri: "/subscriptions/{id}/add_charge_at_term_end", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription add-charge-at-term-end", opts.yes === true); + await ensureWriteAllowed("POST", "subscription add-charge-at-term-end", opts); try { const client = await getClient(); const result = await (client as any).subscription.addChargeAtTermEnd(resource.id, params); @@ -48,16 +49,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription cancel\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "cancel_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "subscription cancel"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "cancel_a_subscription", method: "POST", uri: "/subscriptions/{id}/cancel", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription cancel", opts.yes === true); + await ensureWriteAllowed("POST", "subscription cancel", opts); try { const client = await getClient(); const result = await (client as any).subscription.cancel(resource.id, params); @@ -73,16 +75,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription cancel-for-items\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "cancel_subscription_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "subscription cancel-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "cancel_subscription_for_items", opIdV1: "", method: "POST", uri: "/subscriptions/{id}/cancel_for_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription cancel-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "subscription cancel-for-items", opts); try { const client = await getClient(); const result = await (client as any).subscription.cancelForItems(resource.id, params); @@ -98,15 +101,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription change-term-end\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "change_term_end", opIdV1: "change_term_end", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "change_term_end", opIdV1: "change_term_end", method: "POST", uri: "/subscriptions/{id}/change_term_end", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription change-term-end", opts.yes === true); + await ensureWriteAllowed("POST", "subscription change-term-end", opts); try { const client = await getClient(); const result = await (client as any).subscription.changeTermEnd(resource.id, params); @@ -122,16 +126,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription charge-addon-at-term-end\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "charge_addon_at_term_end", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "subscription charge-addon-at-term-end"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "charge_addon_at_term_end", method: "POST", uri: "/subscriptions/{id}/charge_addon_at_term_end", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription charge-addon-at-term-end", opts.yes === true); + await ensureWriteAllowed("POST", "subscription charge-addon-at-term-end", opts); try { const client = await getClient(); const result = await (client as any).subscription.chargeAddonAtTermEnd(resource.id, params); @@ -147,15 +152,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription charge-future-renewals\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "charge_future_renewals", opIdV1: "charge_future_renewals", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "charge_future_renewals", opIdV1: "charge_future_renewals", method: "POST", uri: "/subscriptions/{id}/charge_future_renewals", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription charge-future-renewals", opts.yes === true); + await ensureWriteAllowed("POST", "subscription charge-future-renewals", opts); try { const client = await getClient(); const result = await (client as any).subscription.chargeFutureRenewals(resource.id, params); @@ -192,14 +198,15 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "subscription create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_a_subscription", method: "POST", uri: "/subscriptions", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "subscription create", opts.yes === true); + await ensureWriteAllowed("POST", "subscription create", opts); try { const client = await getClient(); const result = await (client as any).subscription.create(params); @@ -215,16 +222,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription create-for-customer\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_subscription_for_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "subscription create-for-customer"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_subscription_for_customer", method: "POST", uri: "/customers/{id}/subscriptions", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription create-for-customer", opts.yes === true); + await ensureWriteAllowed("POST", "subscription create-for-customer", opts); try { const client = await getClient(); const result = await (client as any).subscription.createForCustomer(resource.id, params); @@ -240,16 +248,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription create-with-items\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_subscription_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "subscription create-with-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_subscription_for_items", opIdV1: "", method: "POST", uri: "/customers/{id}/subscription_for_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription create-with-items", opts.yes === true); + await ensureWriteAllowed("POST", "subscription create-with-items", opts); try { const client = await getClient(); const result = await (client as any).subscription.createWithItems(resource.id, params); @@ -265,15 +274,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_subscription", opIdV1: "delete_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_subscription", opIdV1: "delete_a_subscription", method: "POST", uri: "/subscriptions/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription delete", opts.yes === true); + await ensureWriteAllowed("POST", "subscription delete", opts); try { const client = await getClient(); const result = await (client as any).subscription.delete(resource.id, params); @@ -289,15 +299,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription edit-advance-invoice-schedule\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "edit_advance_invoice_schedule", opIdV1: "edit_advance_invoice_schedule", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "edit_advance_invoice_schedule", opIdV1: "edit_advance_invoice_schedule", method: "POST", uri: "/subscriptions/{id}/edit_advance_invoice_schedule", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription edit-advance-invoice-schedule", opts.yes === true); + await ensureWriteAllowed("POST", "subscription edit-advance-invoice-schedule", opts); try { const client = await getClient(); const result = await (client as any).subscription.editAdvanceInvoiceSchedule(resource.id, params); @@ -313,15 +324,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription import-contract-term\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "import_contract_term", opIdV1: "import_contract_term", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "import_contract_term", opIdV1: "import_contract_term", method: "POST", uri: "/subscriptions/{id}/import_contract_term", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription import-contract-term", opts.yes === true); + await ensureWriteAllowed("POST", "subscription import-contract-term", opts); try { const client = await getClient(); const result = await (client as any).subscription.importContractTerm(resource.id, params); @@ -337,16 +349,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription import-for-customer\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "import_subscription_for_customer", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "subscription import-for-customer"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "import_subscription_for_customer", method: "POST", uri: "/customers/{id}/import_subscription", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription import-for-customer", opts.yes === true); + await ensureWriteAllowed("POST", "subscription import-for-customer", opts); try { const client = await getClient(); const result = await (client as any).subscription.importForCustomer(resource.id, params); @@ -362,16 +375,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription import-for-items\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "import_subscription_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "subscription import-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "import_subscription_for_items", opIdV1: "", method: "POST", uri: "/customers/{id}/import_for_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "customer-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'customer-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription import-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "subscription import-for-items", opts); try { const client = await getClient(); const result = await (client as any).subscription.importForItems(resource.id, params); @@ -386,14 +400,15 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription import-subscription\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "import_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "subscription import-subscription"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "import_a_subscription", method: "POST", uri: "/subscriptions/import_subscription", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "subscription import-subscription", opts.yes === true); + await ensureWriteAllowed("POST", "subscription import-subscription", opts); try { const client = await getClient(); const result = await (client as any).subscription.importSubscription(params); @@ -409,15 +424,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription import-unbilled-charges\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "import_unbilled_charges", opIdV1: "import_unbilled_charges", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "import_unbilled_charges", opIdV1: "import_unbilled_charges", method: "POST", uri: "/subscriptions/{id}/import_unbilled_charges", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription import-unbilled-charges", opts.yes === true); + await ensureWriteAllowed("POST", "subscription import-unbilled-charges", opts); try { const client = await getClient(); const result = await (client as any).subscription.importUnbilledCharges(resource.id, params); @@ -478,15 +494,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription move\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "move_a_subscription", opIdV1: "move_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "move_a_subscription", opIdV1: "move_a_subscription", method: "POST", uri: "/subscriptions/{id}/move", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription move", opts.yes === true); + await ensureWriteAllowed("POST", "subscription move", opts); try { const client = await getClient(); const result = await (client as any).subscription.move(resource.id, params); @@ -502,15 +519,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription override-billing-profile\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "override_billing_profile", opIdV1: "override_billing_profile", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "override_billing_profile", opIdV1: "override_billing_profile", method: "POST", uri: "/subscriptions/{id}/override_billing_profile", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription override-billing-profile", opts.yes === true); + await ensureWriteAllowed("POST", "subscription override-billing-profile", opts); try { const client = await getClient(); const result = await (client as any).subscription.overrideBillingProfile(resource.id, params); @@ -526,15 +544,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription pause\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "pause_a_subscription", opIdV1: "pause_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "pause_a_subscription", opIdV1: "pause_a_subscription", method: "POST", uri: "/subscriptions/{id}/pause", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription pause", opts.yes === true); + await ensureWriteAllowed("POST", "subscription pause", opts); try { const client = await getClient(); const result = await (client as any).subscription.pause(resource.id, params); @@ -550,15 +569,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription reactivate\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "reactivate_a_subscription", opIdV1: "reactivate_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "reactivate_a_subscription", opIdV1: "reactivate_a_subscription", method: "POST", uri: "/subscriptions/{id}/reactivate", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription reactivate", opts.yes === true); + await ensureWriteAllowed("POST", "subscription reactivate", opts); try { const client = await getClient(); const result = await (client as any).subscription.reactivate(resource.id, params); @@ -574,15 +594,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription regenerate-invoice\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "regenerate_an_invoice", opIdV1: "regenerate_an_invoice", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "regenerate_an_invoice", opIdV1: "regenerate_an_invoice", method: "POST", uri: "/subscriptions/{id}/regenerate_invoice", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription regenerate-invoice", opts.yes === true); + await ensureWriteAllowed("POST", "subscription regenerate-invoice", opts); try { const client = await getClient(); const result = await (client as any).subscription.regenerateInvoice(resource.id, params); @@ -598,15 +619,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription remove-advance-invoice-schedule\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_an_advance_invoice_schedules", opIdV1: "remove_an_advance_invoice_schedules", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_an_advance_invoice_schedules", opIdV1: "remove_an_advance_invoice_schedules", method: "POST", uri: "/subscriptions/{id}/remove_advance_invoice_schedule", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription remove-advance-invoice-schedule", opts.yes === true); + await ensureWriteAllowed("POST", "subscription remove-advance-invoice-schedule", opts); try { const client = await getClient(); const result = await (client as any).subscription.removeAdvanceInvoiceSchedule(resource.id, params); @@ -622,15 +644,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription remove-coupons\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_coupons", opIdV1: "remove_coupons", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_coupons", opIdV1: "remove_coupons", method: "POST", uri: "/subscriptions/{id}/remove_coupons", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription remove-coupons", opts.yes === true); + await ensureWriteAllowed("POST", "subscription remove-coupons", opts); try { const client = await getClient(); const result = await (client as any).subscription.removeCoupons(resource.id, params); @@ -646,15 +669,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription remove-scheduled-cancellation\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_scheduled_cancellation", opIdV1: "remove_scheduled_cancellation", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_scheduled_cancellation", opIdV1: "remove_scheduled_cancellation", method: "POST", uri: "/subscriptions/{id}/remove_scheduled_cancellation", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription remove-scheduled-cancellation", opts.yes === true); + await ensureWriteAllowed("POST", "subscription remove-scheduled-cancellation", opts); try { const client = await getClient(); const result = await (client as any).subscription.removeScheduledCancellation(resource.id, params); @@ -670,15 +694,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription remove-scheduled-changes\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_scheduled_changes", opIdV1: "remove_scheduled_changes", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_scheduled_changes", opIdV1: "remove_scheduled_changes", method: "POST", uri: "/subscriptions/{id}/remove_scheduled_changes", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription remove-scheduled-changes", opts.yes === true); + await ensureWriteAllowed("POST", "subscription remove-scheduled-changes", opts); try { const client = await getClient(); const result = await (client as any).subscription.removeScheduledChanges(resource.id, params); @@ -694,15 +719,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription remove-scheduled-pause\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_scheduled_pause", opIdV1: "remove_scheduled_pause", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_scheduled_pause", opIdV1: "remove_scheduled_pause", method: "POST", uri: "/subscriptions/{id}/remove_scheduled_pause", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription remove-scheduled-pause", opts.yes === true); + await ensureWriteAllowed("POST", "subscription remove-scheduled-pause", opts); try { const client = await getClient(); const result = await (client as any).subscription.removeScheduledPause(resource.id, params); @@ -718,15 +744,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription remove-scheduled-resumption\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "remove_scheduled_resumption", opIdV1: "remove_scheduled_resumption", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "remove_scheduled_resumption", opIdV1: "remove_scheduled_resumption", method: "POST", uri: "/subscriptions/{id}/remove_scheduled_resumption", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription remove-scheduled-resumption", opts.yes === true); + await ensureWriteAllowed("POST", "subscription remove-scheduled-resumption", opts); try { const client = await getClient(); const result = await (client as any).subscription.removeScheduledResumption(resource.id, params); @@ -742,15 +769,16 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription resume\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "resume_a_subscription", opIdV1: "resume_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "resume_a_subscription", opIdV1: "resume_a_subscription", method: "POST", uri: "/subscriptions/{id}/resume", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription resume", opts.yes === true); + await ensureWriteAllowed("POST", "subscription resume", opts); try { const client = await getClient(); const result = await (client as any).subscription.resume(resource.id, params); @@ -854,16 +882,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "update_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "subscription update"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "update_a_subscription", method: "POST", uri: "/subscriptions/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription update", opts.yes === true); + await ensureWriteAllowed("POST", "subscription update", opts); try { const client = await getClient(); const result = await (client as any).subscription.update(resource.id, params); @@ -879,16 +908,17 @@ export function registerSubscription(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription update-for-items\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_subscription_for_items", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "subscription update-for-items"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_subscription_for_items", opIdV1: "", method: "POST", uri: "/subscriptions/{id}/update_for_items", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription update-for-items", opts.yes === true); + await ensureWriteAllowed("POST", "subscription update-for-items", opts); try { const client = await getClient(); const result = await (client as any).subscription.updateForItems(resource.id, params); diff --git a/src/commands/generated/subscription_entitlement.ts b/src/commands/generated/subscription_entitlement.ts index 52516a5..74cc67c 100644 --- a/src/commands/generated/subscription_entitlement.ts +++ b/src/commands/generated/subscription_entitlement.ts @@ -24,16 +24,17 @@ export function registerSubscriptionEntitlement(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs subscription-entitlement set-subscription-entitlement-availability\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "enable_or_disable_subscription_entitlements", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "subscription-entitlement set-subscription-entitlement-availability"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "enable_or_disable_subscription_entitlements", opIdV1: "", method: "POST", uri: "/subscriptions/{id}/subscription_entitlements/set_availability", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "subscription-entitlement set-subscription-entitlement-availability", opts.yes === true); + await ensureWriteAllowed("POST", "subscription-entitlement set-subscription-entitlement-availability", opts); try { const client = await getClient(); const result = await (client as any).subscriptionEntitlement.setSubscriptionEntitlementAvailability(resource.id, params); diff --git a/src/commands/generated/time_machine.ts b/src/commands/generated/time_machine.ts index 0ee6718..5f2c011 100644 --- a/src/commands/generated/time_machine.ts +++ b/src/commands/generated/time_machine.ts @@ -46,15 +46,16 @@ export function registerTimeMachine(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs time-machine start-afresh\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "start_afresh", opIdV1: "start_afresh", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "start_afresh", opIdV1: "start_afresh", method: "POST", uri: "/time_machines/{id}/start_afresh", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "time-machine-name", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'time-machine-name'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "time-machine start-afresh", opts.yes === true); + await ensureWriteAllowed("POST", "time-machine start-afresh", opts); try { const client = await getClient(); const result = await (client as any).timeMachine.startAfresh(resource.id, params); @@ -70,15 +71,16 @@ export function registerTimeMachine(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs time-machine travel-forward\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "travel_forward", opIdV1: "travel_forward", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "travel_forward", opIdV1: "travel_forward", method: "POST", uri: "/time_machines/{id}/travel_forward", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "time-machine-name", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'time-machine-name'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "time-machine travel-forward", opts.yes === true); + await ensureWriteAllowed("POST", "time-machine travel-forward", opts); try { const client = await getClient(); const result = await (client as any).timeMachine.travelForward(resource.id, params); diff --git a/src/commands/generated/transaction.ts b/src/commands/generated/transaction.ts index 4f28d38..8306845 100644 --- a/src/commands/generated/transaction.ts +++ b/src/commands/generated/transaction.ts @@ -23,13 +23,14 @@ export function registerTransaction(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs transaction create-authorization\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_authorization_payment", opIdV1: "create_an_authorization_payment", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_authorization_payment", opIdV1: "create_an_authorization_payment", method: "POST", uri: "/transactions/create_authorization", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "transaction create-authorization", opts.yes === true); + await ensureWriteAllowed("POST", "transaction create-authorization", opts); try { const client = await getClient(); const result = await (client as any).transaction.createAuthorization(params); @@ -45,15 +46,16 @@ export function registerTransaction(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs transaction delete-offline-transaction\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_offline_transaction", opIdV1: "delete_an_offline_transaction", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_offline_transaction", opIdV1: "delete_an_offline_transaction", method: "POST", uri: "/transactions/{id}/delete_offline_transaction", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "transaction-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'transaction-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "transaction delete-offline-transaction", opts.yes === true); + await ensureWriteAllowed("POST", "transaction delete-offline-transaction", opts); try { const client = await getClient(); const result = await (client as any).transaction.deleteOfflineTransaction(resource.id, params); @@ -113,15 +115,16 @@ export function registerTransaction(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs transaction reconcile\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "reconcile_transaction", opIdV1: "reconcile_transaction", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "reconcile_transaction", opIdV1: "reconcile_transaction", method: "POST", uri: "/transactions/{id}/reconcile", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "transaction-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'transaction-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "transaction reconcile", opts.yes === true); + await ensureWriteAllowed("POST", "transaction reconcile", opts); try { const client = await getClient(); const result = await (client as any).transaction.reconcile(resource.id, params); @@ -137,15 +140,16 @@ export function registerTransaction(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs transaction record-refund\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "record_an_offline_refund", opIdV1: "record_an_offline_refund", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "record_an_offline_refund", opIdV1: "record_an_offline_refund", method: "POST", uri: "/transactions/{id}/record_refund", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "transaction-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'transaction-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "transaction record-refund", opts.yes === true); + await ensureWriteAllowed("POST", "transaction record-refund", opts); try { const client = await getClient(); const result = await (client as any).transaction.recordRefund(resource.id, params); @@ -161,15 +165,16 @@ export function registerTransaction(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs transaction refund\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "refund_a_payment", opIdV1: "refund_a_payment", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "refund_a_payment", opIdV1: "refund_a_payment", method: "POST", uri: "/transactions/{id}/refund", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "transaction-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'transaction-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "transaction refund", opts.yes === true); + await ensureWriteAllowed("POST", "transaction refund", opts); try { const client = await getClient(); const result = await (client as any).transaction.refund(resource.id, params); @@ -251,15 +256,16 @@ export function registerTransaction(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs transaction void-transaction\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "void_an_authorization_transaction", opIdV1: "void_an_authorization_transaction", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "void_an_authorization_transaction", opIdV1: "void_an_authorization_transaction", method: "POST", uri: "/transactions/{id}/void", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "transaction-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'transaction-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "transaction void-transaction", opts.yes === true); + await ensureWriteAllowed("POST", "transaction void-transaction", opts); try { const client = await getClient(); const result = await (client as any).transaction.voidTransaction(resource.id, params); diff --git a/src/commands/generated/unbilled_charge.ts b/src/commands/generated/unbilled_charge.ts index 04abcd9..8fe582a 100644 --- a/src/commands/generated/unbilled_charge.ts +++ b/src/commands/generated/unbilled_charge.ts @@ -24,14 +24,15 @@ export function registerUnbilledCharge(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs unbilled-charge create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_unbilled_charges_for_item_subscription", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "unbilled-charge create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_unbilled_charges_for_item_subscription", opIdV1: "", method: "POST", uri: "/unbilled_charges", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "unbilled-charge create", opts.yes === true); + await ensureWriteAllowed("POST", "unbilled-charge create", opts); try { const client = await getClient(); const result = await (client as any).unbilledCharge.create(params); @@ -46,14 +47,15 @@ export function registerUnbilledCharge(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs unbilled-charge create-unbilled-charge\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "", opIdV1: "create_unbilled_charges_for_a_subscription", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc1", "unbilled-charge create-unbilled-charge"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "", opIdV1: "create_unbilled_charges_for_a_subscription", method: "POST", uri: "/unbilled_charges/create", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "unbilled-charge create-unbilled-charge", opts.yes === true); + await ensureWriteAllowed("POST", "unbilled-charge create-unbilled-charge", opts); try { const client = await getClient(); const result = await (client as any).unbilledCharge.createUnbilledCharge(params); @@ -69,15 +71,16 @@ export function registerUnbilledCharge(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs unbilled-charge delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_an_unbilled_charge", opIdV1: "delete_an_unbilled_charge", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_an_unbilled_charge", opIdV1: "delete_an_unbilled_charge", method: "POST", uri: "/unbilled_charges/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "unbilled-charge-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'unbilled-charge-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "unbilled-charge delete", opts.yes === true); + await ensureWriteAllowed("POST", "unbilled-charge delete", opts); try { const client = await getClient(); const result = await (client as any).unbilledCharge.delete(resource.id, params); @@ -92,13 +95,14 @@ export function registerUnbilledCharge(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs unbilled-charge invoice-now-estimate\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_estimate_for_unbilled_charges", opIdV1: "create_an_estimate_for_unbilled_charges", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_estimate_for_unbilled_charges", opIdV1: "create_an_estimate_for_unbilled_charges", method: "POST", uri: "/unbilled_charges/invoice_now_estimate", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "unbilled-charge invoice-now-estimate", opts.yes === true); + await ensureWriteAllowed("POST", "unbilled-charge invoice-now-estimate", opts); try { const client = await getClient(); const result = await (client as any).unbilledCharge.invoiceNowEstimate(params); @@ -113,13 +117,14 @@ export function registerUnbilledCharge(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs unbilled-charge invoice-unbilled-charges\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_an_invoice_for_unbilled_charges", opIdV1: "create_an_invoice_for_unbilled_charges", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_an_invoice_for_unbilled_charges", opIdV1: "create_an_invoice_for_unbilled_charges", method: "POST", uri: "/unbilled_charges/invoice_unbilled_charges", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "unbilled-charge invoice-unbilled-charges", opts.yes === true); + await ensureWriteAllowed("POST", "unbilled-charge invoice-unbilled-charges", opts); try { const client = await getClient(); const result = await (client as any).unbilledCharge.invoiceUnbilledCharges(params); diff --git a/src/commands/generated/usage.ts b/src/commands/generated/usage.ts index 3e8a052..70a6a59 100644 --- a/src/commands/generated/usage.ts +++ b/src/commands/generated/usage.ts @@ -24,16 +24,17 @@ export function registerUsage(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs usage create\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_usage", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "usage create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_usage", opIdV1: "", method: "POST", uri: "/subscriptions/{id}/usages", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "usage create", opts.yes === true); + await ensureWriteAllowed("POST", "usage create", opts); try { const client = await getClient(); const result = await (client as any).usage.create(resource.id, params); @@ -49,16 +50,17 @@ export function registerUsage(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs usage delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_usage", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "usage delete"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_usage", opIdV1: "", method: "POST", uri: "/subscriptions/{id}/delete_usage", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "subscription-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'subscription-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "usage delete", opts.yes === true); + await ensureWriteAllowed("POST", "usage delete", opts); try { const client = await getClient(); const result = await (client as any).usage.delete(resource.id, params); diff --git a/src/commands/generated/usage_event.ts b/src/commands/generated/usage_event.ts index d93a301..0d2684e 100644 --- a/src/commands/generated/usage_event.ts +++ b/src/commands/generated/usage_event.ts @@ -21,14 +21,15 @@ export function registerUsageEvent(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs usage-event batch-ingest\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "ingest_usages_in_batch", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "usage-event batch-ingest"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "ingest_usages_in_batch", opIdV1: "", method: "POST", uri: "/batch/usage_events", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "usage-event batch-ingest", opts.yes === true); + await ensureWriteAllowed("POST", "usage-event batch-ingest", opts); try { const client = await getClient(); const result = await (client as any).usageEvent.batchIngest(params); @@ -43,14 +44,15 @@ export function registerUsageEvent(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs usage-event create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: true, opIdV2: "create_a_usage_event", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "usage-event create"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_usage_event", opIdV1: "", method: "POST", uri: "/usage_events", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "usage-event create", opts.yes === true); + await ensureWriteAllowed("POST", "usage-event create", opts); try { const client = await getClient(); const result = await (client as any).usageEvent.create(params); diff --git a/src/commands/generated/usage_file.ts b/src/commands/generated/usage_file.ts index 9c7cab9..34ad82d 100644 --- a/src/commands/generated/usage_file.ts +++ b/src/commands/generated/usage_file.ts @@ -46,14 +46,15 @@ export function registerUsageFile(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs usage-file upload-url\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "get_usages_file_upload_url", opIdV1: "", pcVersionFlag: opts.pcVersion }); if (opts.codeSample !== "list") await ensureCatalogAllowed("pc2", "usage-file upload-url"); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "get_usages_file_upload_url", opIdV1: "", method: "POST", uri: "/usage_files/upload_url", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "usage-file upload-url", opts.yes === true); + await ensureWriteAllowed("POST", "usage-file upload-url", opts); try { const client = await getClient(); const result = await (client as any).usageFile.uploadUrl(params); diff --git a/src/commands/generated/virtual_bank_account.ts b/src/commands/generated/virtual_bank_account.ts index b61c7a4..edf1462 100644 --- a/src/commands/generated/virtual_bank_account.ts +++ b/src/commands/generated/virtual_bank_account.ts @@ -24,13 +24,14 @@ export function registerVirtualBankAccount(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs virtual-bank-account create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_virtual_bank_account", opIdV1: "create_a_virtual_bank_account", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_virtual_bank_account", opIdV1: "create_a_virtual_bank_account", method: "POST", uri: "/virtual_bank_accounts", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "virtual-bank-account create", opts.yes === true); + await ensureWriteAllowed("POST", "virtual-bank-account create", opts); try { const client = await getClient(); const result = await (client as any).virtualBankAccount.create(params); @@ -45,13 +46,14 @@ export function registerVirtualBankAccount(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs virtual-bank-account create-using-permanent-token\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_virtual_bank_account_using_permanent_token", opIdV1: "create_a_virtual_bank_account_using_permanent_token", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_virtual_bank_account_using_permanent_token", opIdV1: "create_a_virtual_bank_account_using_permanent_token", method: "POST", uri: "/virtual_bank_accounts/create_using_permanent_token", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "virtual-bank-account create-using-permanent-token", opts.yes === true); + await ensureWriteAllowed("POST", "virtual-bank-account create-using-permanent-token", opts); try { const client = await getClient(); const result = await (client as any).virtualBankAccount.createUsingPermanentToken(params); @@ -67,15 +69,16 @@ export function registerVirtualBankAccount(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs virtual-bank-account delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_virtual_bank_account", opIdV1: "delete_a_virtual_bank_account", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_virtual_bank_account", opIdV1: "delete_a_virtual_bank_account", method: "POST", uri: "/virtual_bank_accounts/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "virtual-bank-account-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'virtual-bank-account-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "virtual-bank-account delete", opts.yes === true); + await ensureWriteAllowed("POST", "virtual-bank-account delete", opts); try { const client = await getClient(); const result = await (client as any).virtualBankAccount.delete(resource.id, params); @@ -91,15 +94,16 @@ export function registerVirtualBankAccount(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs virtual-bank-account delete-local\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "local_delete_a_virtual_bank_account", opIdV1: "local_delete_a_virtual_bank_account", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "local_delete_a_virtual_bank_account", opIdV1: "local_delete_a_virtual_bank_account", method: "POST", uri: "/virtual_bank_accounts/{id}/delete_local", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "virtual-bank-account-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'virtual-bank-account-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "virtual-bank-account delete-local", opts.yes === true); + await ensureWriteAllowed("POST", "virtual-bank-account delete-local", opts); try { const client = await getClient(); const result = await (client as any).virtualBankAccount.deleteLocal(resource.id, params); diff --git a/src/commands/generated/webhook_endpoint.ts b/src/commands/generated/webhook_endpoint.ts index 1ba922a..daeaf9b 100644 --- a/src/commands/generated/webhook_endpoint.ts +++ b/src/commands/generated/webhook_endpoint.ts @@ -24,13 +24,14 @@ export function registerWebhookEndpoint(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs webhook-endpoint create\n") - .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const fromStdin = readJsonMarker(json, command); const params = await loadOperationParams(opts.data ?? [], fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "create_a_webhook_endpoint", opIdV1: "create_a_webhook_endpoint", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "create_a_webhook_endpoint", opIdV1: "create_a_webhook_endpoint", method: "POST", uri: "/webhook_endpoints", dataFlags: opts.data ?? [], params, pcVersionFlag: opts.pcVersion }); - await ensureWriteAllowed("POST", "webhook-endpoint create", opts.yes === true); + await ensureWriteAllowed("POST", "webhook-endpoint create", opts); try { const client = await getClient(); const result = await (client as any).webhookEndpoint.create(params); @@ -46,15 +47,16 @@ export function registerWebhookEndpoint(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs webhook-endpoint delete\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "delete_a_webhook_endpoint", opIdV1: "delete_a_webhook_endpoint", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "delete_a_webhook_endpoint", opIdV1: "delete_a_webhook_endpoint", method: "POST", uri: "/webhook_endpoints/{id}/delete", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "webhook-endpoint-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'webhook-endpoint-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "webhook-endpoint delete", opts.yes === true); + await ensureWriteAllowed("POST", "webhook-endpoint delete", opts); try { const client = await getClient(); const result = await (client as any).webhookEndpoint.delete(resource.id, params); @@ -114,15 +116,16 @@ export function registerWebhookEndpoint(parent: Command): void { .option("-d, --data ", "Request parameters in key=value format; repeat for multiple fields") .option("-s, --code-sample ", "Generate code sample (curl, python, nodejs, go, ruby, java, php, dotnet, list)") .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp()) - .option("-y, --yes", "Skip the confirmation prompt for writes on a live site") + .option("--allow-write", "Allow this write on a live site without a confirmation prompt") + .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp()) .addHelpText("after", "\n\u001b[1mDOCUMENTATION\u001b[0m\n chargebee docs webhook-endpoint update\n") - .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }, command: Command) => { + .action(async (id: string | undefined, json: string | undefined, opts: { data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }, command: Command) => { const resource = takeResourceId(id, json, command); const params = await loadOperationParams(opts.data ?? [], resource.fromStdin, command, { method: "POST", jsonInput: false, opIdV2: "update_a_webhook_endpoint", opIdV1: "update_a_webhook_endpoint", pcVersionFlag: opts.pcVersion }); if (opts.codeSample) return handleCodeSample({ lang: opts.codeSample, opIdV2: "update_a_webhook_endpoint", opIdV1: "update_a_webhook_endpoint", method: "POST", uri: "/webhook_endpoints/{id}", dataFlags: opts.data ?? [], params, resourceId: resource.id, pathParamName: "webhook-endpoint-id", pcVersionFlag: opts.pcVersion }); if (!resource.id) command.error("error: missing required argument 'webhook-endpoint-id'"); assertResourceId(resource.id, command); - await ensureWriteAllowed("POST", "webhook-endpoint update", opts.yes === true); + await ensureWriteAllowed("POST", "webhook-endpoint update", opts); try { const client = await getClient(); const result = await (client as any).webhookEndpoint.update(resource.id, params); diff --git a/src/commands/help.ts b/src/commands/help.ts index 8dd2b69..0a8f0a4 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -80,7 +80,7 @@ export function renderHelp(program: Command, _version: string): string { lines.push(` ${"CLI source".padEnd(nameW)} https://github.com/chargebee/cli`); lines.push(""); - lines.push("Write operations on live sites ask for confirmation; scripts pass --yes."); + lines.push("Write operations on live sites ask for confirmation; scripts pass --allow-write."); lines.push('Run "chargebee --help" for details.'); return lines.join("\n"); diff --git a/src/lib/api/sdk.ts b/src/lib/api/sdk.ts index bdd49fc..839fd57 100644 --- a/src/lib/api/sdk.ts +++ b/src/lib/api/sdk.ts @@ -12,6 +12,7 @@ import { } from "../config/host.js"; import { DEFAULT_REGION, parseRegion, type Region } from "../config/region.js"; import { + DEPRECATED_YES_NOTICE, isWriteMethod, liveWriteDecision, liveWriteNotice, @@ -382,11 +383,18 @@ export async function ensureCatalogAllowed(opCatalog: CatalogTag, commandName: s } /** - * Require confirmation (prompt or `--yes`) for writes on live sites. + * Require confirmation (prompt or `--allow-write`) for writes on live sites. + * `yes` is the deprecated `-y/--yes` alias for `allowWrite`. * Unresolved credentials fail open so the API error surfaces. */ -export async function ensureWriteAllowed(method: string, commandName: string, yes = false): Promise { +export async function ensureWriteAllowed( + method: string, + commandName: string, + confirmation: { allowWrite?: boolean; yes?: boolean } = {}, +): Promise { if (!isWriteMethod(method)) return; + if (confirmation.yes === true && confirmation.allowWrite !== true) diagnostic(DEPRECATED_YES_NOTICE); + const allowWrite = confirmation.allowWrite === true || confirmation.yes === true; let site: string; let apiKey: string; @@ -398,7 +406,7 @@ export async function ensureWriteAllowed(method: string, commandName: string, ye // CI runners can allocate pseudo-terminals; nobody is there to answer the prompt. const interactive = canPrompt() && !detectIsCi(); - const decision = liveWriteDecision({ method, site, apiKey, yes, canPrompt: interactive }); + const decision = liveWriteDecision({ method, site, apiKey, allowWrite, canPrompt: interactive }); if (decision === "allow") return; if (decision === "refuse") { diff --git a/src/lib/api/write-gate.ts b/src/lib/api/write-gate.ts index d5edbfa..fac3157 100644 --- a/src/lib/api/write-gate.ts +++ b/src/lib/api/write-gate.ts @@ -2,8 +2,8 @@ * Pure logic for the live-site write confirmation gate. * * Write operations on live (production) sites need explicit confirmation: an - * interactive yes/no prompt, or `--yes`. Without a terminal and without - * `--yes` the write is refused. + * interactive yes/no prompt, or `--allow-write`. Without a terminal and without + * `--allow-write` the write is refused. * * Kept separate from `sdk.ts` (which imports the Chargebee SDK and is a common * mock target in tests) so this logic can be unit-tested in isolation. @@ -98,9 +98,9 @@ export function isReadOnlyOperation(operationKey?: string): boolean { /** * How a write should proceed: * - `allow`: not a write, or not a live site — run without ceremony. - * - `allow_live`: live-site write confirmed up front with `--yes`. + * - `allow_live`: live-site write confirmed up front with `--allow-write`. * - `confirm`: live-site write that must be confirmed at an interactive prompt. - * - `refuse`: live-site write with no `--yes` and no way to prompt. + * - `refuse`: live-site write with no `--allow-write` and no way to prompt. */ export type WriteDecision = "allow" | "allow_live" | "confirm" | "refuse"; @@ -108,11 +108,11 @@ export function liveWriteDecision(opts: { method: string; site: string; apiKey?: string; - yes: boolean; + allowWrite: boolean; canPrompt: boolean; }): WriteDecision { if (!isWriteMethod(opts.method) || !isLiveSite(opts.site, opts.apiKey)) return "allow"; - if (opts.yes) return "allow_live"; + if (opts.allowWrite) return "allow_live"; return opts.canPrompt ? "confirm" : "refuse"; } @@ -126,12 +126,16 @@ export function liveWriteNotice(site: string): string { return `${paint("33", "⚠")} Writing to live site "${site}".`; } +/** The stderr notice printed when the deprecated `-y/--yes` confirms a write. */ +export const DEPRECATED_YES_NOTICE = + "warning: -y/--yes on API write commands is deprecated and will be removed in the next major version; use --allow-write."; + /** The message shown when a live-site write cannot be confirmed. */ export function unconfirmedWriteMessage(site: string, commandName: string): string { return ( `${paint("31", "✗")} Refusing to run a write operation on live site "${site}" without confirmation.\n\n` + ` "${commandName}" changes data on a live (production) site.\n` + - " Re-run with --yes to confirm, or run it in a terminal to answer the prompt.\n" + + " Re-run with --allow-write to confirm, or run it in a terminal to answer the prompt.\n" + ' To experiment safely, use a test site (name ending in "-test", or a test_ API key).\n' ); } diff --git a/src/lib/skills/content/SKILL.md b/src/lib/skills/content/SKILL.md index 9943e9b..1abccea 100644 --- a/src/lib/skills/content/SKILL.md +++ b/src/lib/skills/content/SKILL.md @@ -68,11 +68,11 @@ For important changes, retrieve the resource afterward or inspect the command re ### Live-site safety -Write operations on live (production) sites change real billing data and need confirmation. In a terminal the CLI asks yes/no; without one (as when an agent runs it) the command is refused with exit code `6` unless `--yes` is passed. +Write operations on live (production) sites change real billing data and need confirmation. In a terminal the CLI asks yes/no; without one (as when an agent runs it) the command is refused with exit code `6` unless `--allow-write` is passed. - Use a test site for create, update, and delete operations unless the user explicitly asks to change the live site. -- Never add `--yes` to a write on a live site on your own. Before running it, tell the user the site and the exact command, and get their explicit confirmation for that write. -- If a live-site write is refused, report the refusal and ask the user; do not retry with `--yes` automatically. +- Never add `--allow-write` to a write on a live site on your own. Before running it, tell the user the site and the exact command, and get their explicit confirmation for that write. +- If a live-site write is refused, report the refusal and ask the user; do not retry with `--allow-write` automatically. ### Product Catalog diff --git a/src/lib/skills/content/references/commands.md b/src/lib/skills/content/references/commands.md index 194bd19..79e61cf 100644 --- a/src/lib/skills/content/references/commands.md +++ b/src/lib/skills/content/references/commands.md @@ -233,10 +233,10 @@ A site is considered live unless: On a live site: - In a terminal, the CLI asks `Run "" on LIVE site ""?` (default No). -- `-y` / `--yes` skips the prompt and runs the write. -- Without a terminal, on a CI runner, in `--json` mode, or with a stdin JSON body, a write without `--yes` is refused with exit code `6` (`live_write_refused`). Declining the prompt also exits `6` (`live_write_declined`). +- `--allow-write` skips the prompt and runs the write. The older `-y` / `--yes` still works but is deprecated and prints a warning. +- Without a terminal, on a CI runner, in `--json` mode, or with a stdin JSON body, a write without `--allow-write` is refused with exit code `6` (`live_write_refused`). Declining the prompt also exits `6` (`live_write_declined`). -Reads and explicitly allowed non-mutating operations (estimates, exports, hosted-page URLs, PDF downloads) run on live sites without confirmation. Only pass `--yes` on a live site when the user has explicitly confirmed that write. +Reads and explicitly allowed non-mutating operations (estimates, exports, hosted-page URLs, PDF downloads) run on live sites without confirmation. Only pass `--allow-write` on a live site when the user has explicitly confirmed that write. ### Product Catalog diff --git a/src/lib/skills/content/references/workflows.md b/src/lib/skills/content/references/workflows.md index db110b8..0a5e8e7 100644 --- a/src/lib/skills/content/references/workflows.md +++ b/src/lib/skills/content/references/workflows.md @@ -240,7 +240,7 @@ If a project skill path resolves to a global installation, it is global only: pr | Not configured | Run `chargebee auth add` or set both authentication environment variables. | | Invalid API key | Verify the key belongs to the configured site. | | Catalog mismatch | Check `chargebee auth status` and use the operation for that catalog. | -| Live-site write refused | Ask the user whether to change the live site; add `--yes` only after they confirm, otherwise use a test site. | +| Live-site write refused | Ask the user whether to change the live site; add `--allow-write` only after they confirm, otherwise use a test site. | | Unknown command/resource | Run `chargebee resources` or `chargebee --help`. | | Code sample unavailable | Use `chargebee docs ` for the API reference and construct the request from the documented parameters. | | Webhook listen blocked | Use a test site. | diff --git a/src/tests/integration/live-site-write-gate.test.ts b/src/tests/integration/live-site-write-gate.test.ts index a7bb223..c80ca1f 100644 --- a/src/tests/integration/live-site-write-gate.test.ts +++ b/src/tests/integration/live-site-write-gate.test.ts @@ -2,7 +2,7 @@ * Isolated CLI tests: the live-site write confirmation as emitted into the * generated commands. A live site refuses unconfirmed mutating operations before * any SDK client is constructed, runs them once confirmed at the prompt or with - * --yes, still runs reads, and still runs the non-GET operations that only + * --allow-write (or the deprecated -y/--yes), still runs reads, and still runs the non-GET operations that only * compute or generate URLs (estimates, exports). A test site runs writes. */ import { afterEach, beforeEach, describe, expect, it } from "bun:test"; @@ -24,6 +24,7 @@ import { const REFUSAL = "Refusing to run a write operation on live site"; const NOTICE = 'Writing to live site "acme"'; +const DEPRECATION = "-y/--yes on API write commands is deprecated"; let configDir: string; let constructions: ClientConstruction[]; @@ -76,7 +77,7 @@ describe("live site without a terminal", () => { const result = await runCli(["customer", "create", "-d", "first_name=Ada"]); expect(result.exitCode).toBe(6); expect(result.stderr).toContain(REFUSAL); - expect(result.stderr).toContain("--yes"); + expect(result.stderr).toContain("--allow-write"); expect(constructions).toHaveLength(0); }); @@ -87,17 +88,44 @@ describe("live site without a terminal", () => { expect(constructions).toHaveLength(0); }); - it("runs a write confirmed with --yes", async () => { - const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--yes"]); + it("runs a write confirmed with --allow-write", async () => { + const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--allow-write"]); expect(result.exitCode).toBe(0); expect(result.stdout).toContain("cus_new_acme"); expect(result.stderr).toContain(NOTICE); }); - it("accepts -y as the short form of --yes", async () => { + it("does not warn about deprecation for --allow-write", async () => { + const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--allow-write"]); + expect(result.stderr).not.toContain(DEPRECATION); + }); + + it("still accepts the deprecated --yes and warns", async () => { + const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--yes"]); + expect(result.exitCode).toBe(0); + expect(result.stdout).toContain("cus_new_acme"); + expect(result.stderr).toContain(DEPRECATION); + expect(result.stderr).toContain("--allow-write"); + }); + + it("still accepts the deprecated -y and warns", async () => { const result = await runCli(["customer", "create", "-y", "-d", "first_name=Ada"]); expect(result.exitCode).toBe(0); expect(result.stdout).toContain("cus_new_acme"); + expect(result.stderr).toContain(DEPRECATION); + }); + + it("does not warn when --yes is passed alongside --allow-write", async () => { + const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--allow-write", "--yes"]); + expect(result.exitCode).toBe(0); + expect(result.stderr).not.toContain(DEPRECATION); + }); + + it("lists --allow-write in help and hides the deprecated --yes", async () => { + const result = await runCli(["customer", "create", "--help"]); + const help = result.stdout + result.stderr; + expect(help).toContain("--allow-write"); + expect(help).not.toContain("--yes"); }); it("refuses an unconfirmed write in --json mode with a structured error", async () => { @@ -107,8 +135,8 @@ describe("live site without a terminal", () => { expect(constructions).toHaveLength(0); }); - it("runs a write confirmed with --yes in --json mode", async () => { - const result = await runCli(["--json", "customer", "create", "-d", "first_name=Ada", "--yes"]); + it("runs a write confirmed with --allow-write in --json mode", async () => { + const result = await runCli(["--json", "customer", "create", "-d", "first_name=Ada", "--allow-write"]); expect(result.exitCode).toBe(0); expect(result.stdout).toContain("cus_new_acme"); }); @@ -174,9 +202,9 @@ describe("live site in a terminal", () => { expect(constructions).toHaveLength(0); }); - it("skips the prompt with --yes", async () => { + it("skips the prompt with --allow-write", async () => { useTerminal(false); - const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--yes"]); + const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--allow-write"]); expect(prompts).toHaveLength(0); expect(result.exitCode).toBe(0); }); @@ -191,10 +219,10 @@ describe("live site in a terminal", () => { expect(constructions).toHaveLength(0); }); - it("runs a write confirmed with --yes on a CI runner with a terminal", async () => { + it("runs a write confirmed with --allow-write on a CI runner with a terminal", async () => { useTerminal(false); env.set("CI", "true"); - const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--yes"]); + const result = await runCli(["customer", "create", "-d", "first_name=Ada", "--allow-write"]); expect(prompts).toHaveLength(0); expect(result.exitCode).toBe(0); }); diff --git a/src/tests/unit/lib/api/write-gate.test.ts b/src/tests/unit/lib/api/write-gate.test.ts index ad4fea8..a4efb56 100644 --- a/src/tests/unit/lib/api/write-gate.test.ts +++ b/src/tests/unit/lib/api/write-gate.test.ts @@ -56,8 +56,8 @@ describe("isWriteMethod", () => { }); describe("liveWriteDecision", () => { - const decide = (o: { method?: string; site?: string; apiKey?: string; yes?: boolean; canPrompt?: boolean }) => - liveWriteDecision({ method: "POST", site: "acme", yes: false, canPrompt: false, ...o }); + const decide = (o: { method?: string; site?: string; apiKey?: string; allowWrite?: boolean; canPrompt?: boolean }) => + liveWriteDecision({ method: "POST", site: "acme", allowWrite: false, canPrompt: false, ...o }); it("allows reads on any site, with or without a terminal", () => { expect(decide({ method: "GET" })).toBe("allow"); @@ -68,7 +68,7 @@ describe("liveWriteDecision", () => { expect(decide({ site: "acme-test" })).toBe("allow"); expect(decide({ site: "acme-test", apiKey: "live_x" })).toBe("allow"); expect(decide({ site: "acme", apiKey: "test_x" })).toBe("allow"); - expect(decide({ site: "acme-test", yes: true })).toBe("allow"); + expect(decide({ site: "acme-test", allowWrite: true })).toBe("allow"); }); it("asks for confirmation on a live site when a prompt is possible", () => { @@ -81,9 +81,9 @@ describe("liveWriteDecision", () => { expect(decide({ method: "PUT" })).toBe("refuse"); }); - it("runs a live-site write confirmed with --yes, prompt or not", () => { - expect(decide({ yes: true })).toBe("allow_live"); - expect(decide({ yes: true, canPrompt: true })).toBe("allow_live"); + it("runs a live-site write confirmed with --allow-write, prompt or not", () => { + expect(decide({ allowWrite: true })).toBe("allow_live"); + expect(decide({ allowWrite: true, canPrompt: true })).toBe("allow_live"); }); }); @@ -157,17 +157,17 @@ describe("generated write gate emission (resource+action allowlist)", () => { it("customer create stays gated (confirmed on live, allowed on test site)", () => { expect(isGated("POST", "customer.create")).toBe(true); - expect(liveWriteDecision({ method: "POST", site: "acme", yes: false, canPrompt: false })).toBe("refuse"); - expect(liveWriteDecision({ method: "POST", site: "acme-test", yes: false, canPrompt: false })).toBe("allow"); + expect(liveWriteDecision({ method: "POST", site: "acme", allowWrite: false, canPrompt: false })).toBe("refuse"); + expect(liveWriteDecision({ method: "POST", site: "acme-test", allowWrite: false, canPrompt: false })).toBe("allow"); }); }); describe("live-site write messages", () => { - it("refusal names the site and command and explains --yes", () => { + it("refusal names the site and command and explains --allow-write", () => { const msg = unconfirmedWriteMessage("acme", "customer create"); expect(msg).toContain('Refusing to run a write operation on live site "acme"'); expect(msg).toContain('"customer create"'); - expect(msg).toContain("--yes"); + expect(msg).toContain("--allow-write"); expect(msg).toContain("name ending in \"-test\", or a test_ API key"); }); diff --git a/src/tools/generate.ts b/src/tools/generate.ts index a6302a4..5f28a40 100644 --- a/src/tools/generate.ts +++ b/src/tools/generate.ts @@ -507,9 +507,9 @@ function generateResourceFile(r: Resource): string { op.method.toUpperCase() !== "GET" && !isReadOnlyOperation(`${r.sdkName}.${op.sdkAction}`); const list = isListOp(op.cliCommand); const optsType = isWrite - ? `{ data?: string[]; codeSample?: string; pcVersion?: string; yes?: boolean }` + ? `{ data?: string[]; codeSample?: string; pcVersion?: string; allowWrite?: boolean; yes?: boolean }` : `{ data?: string[]; codeSample?: string; pcVersion?: string }`; - const writeCheck = ` await ensureWriteAllowed("${op.method}", "${r.cliName} ${op.cliCommand}", opts.yes === true);`; + const writeCheck = ` await ensureWriteAllowed("${op.method}", "${r.cliName} ${op.cliCommand}", opts);`; const dataHelp = list ? "Parameters as key=value. List filters require an operator suffix (id[is]=…). Bare keys: limit, offset, include_deleted." : "Request parameters in key=value format; repeat for multiple fields"; @@ -535,7 +535,9 @@ function generateResourceFile(r: Resource): string { // Preserve the existing override for scripts without foregrounding it in help. L.push(` .addOption(new Option("--pc-version ", "Product catalog version for the code sample (v1 or v2)").hideHelp())`); if (isWrite) { - L.push(` .option("-y, --yes", "Skip the confirmation prompt for writes on a live site")`); + L.push(` .option("--allow-write", "Allow this write on a live site without a confirmation prompt")`); + // Deprecated alias kept for scripts written against v1.5.1; remove in the next major. + L.push(` .addOption(new Option("-y, --yes", "Deprecated alias for --allow-write").hideHelp())`); } if (list) { L.push(` .addHelpText("after", "${listHelp}")`);