All files / src/commands send-envelope.ts

100% Statements 4/4
100% Branches 2/2
100% Functions 2/2
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62                      11x                   3x                                                               3x 3x              
/**
 * `sentry send-envelope` — Deprecated. Suggests `sentry event send --raw`.
 *
 * Kept as a hidden backward-compat alias that prints a deprecation notice
 * and forwards to `sentry event send --raw`.
 */
 
import type { SentryContext } from "../context.js";
import { buildCommand } from "../lib/command.js";
import { CliError, EXIT } from "../lib/errors.js";
 
export const sendEnvelopeCommand = buildCommand({
  docs: {
    brief: "Send a Sentry envelope file (deprecated)",
    fullDescription:
      "This command has been replaced by `sentry event send --raw <file>`.\n\n" +
      "Use `sentry event send --raw ./captured.envelope` instead.",
  },
  auth: false,
  skipRcUrlCheck: true,
  output: {
    human: () => "",
  },
  parameters: {
    positional: {
      kind: "array",
      parameter: {
        brief: "Path(s) to envelope file(s)",
        parse: String,
        optional: true,
      },
    },
    flags: {
      dsn: {
        kind: "parsed",
        parse: String,
        brief: "DSN",
        optional: true,
      },
      raw: {
        kind: "boolean",
        brief: "Raw mode",
        default: false,
        optional: true,
      },
    },
  },
  // biome-ignore lint/correctness/useYield lint/suspicious/useAwait: deprecation shim — throws before yielding
  async *func(
    this: SentryContext,
    _flags: { dsn?: string; raw?: boolean },
    ...files: string[]
  ) {
    const fileArgs = files.length > 0 ? ` ${files.join(" ")}` : " <file>";
    throw new CliError(
      "`sentry send-envelope` has been removed.\n" +
        `Use: sentry event send --raw${fileArgs}`,
      EXIT.GENERAL
    );
  },
});