"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WORKFLOW_COMMAND_OPTION_BY_FLAG = exports.WORKFLOW_COMMAND_OPTION_SPECS = exports.SIDE_WORKFLOW_COMMAND_OPTION_SPECS = exports.WORKFLOW_SELECTION_COMMAND_OPTION_SPEC = void 0;
exports.resolveWorkflowCommandOptionValueKind = resolveWorkflowCommandOptionValueKind;
exports.WORKFLOW_SELECTION_COMMAND_OPTION_SPEC = {
    kind: "workflow-selection",
    flag: "--workflow",
    valueKind: "required",
};
const WORKFLOW_SELECTION_ALIAS_COMMAND_OPTION_SPEC = {
    kind: "workflow-selection",
    flag: "-w",
    valueKind: "required",
};
const WORKFLOW_SELECTION_COMMAND_OPTION_SPECS = [
    exports.WORKFLOW_SELECTION_COMMAND_OPTION_SPEC,
    WORKFLOW_SELECTION_ALIAS_COMMAND_OPTION_SPEC,
];
exports.SIDE_WORKFLOW_COMMAND_OPTION_SPECS = [
    {
        kind: "side-workflow",
        flag: "--pr-workflow",
        valueKind: "required",
        surface: "pull_request",
    },
    {
        kind: "side-workflow",
        flag: "--unplanned-workflow",
        valueKind: "required",
        surface: "unplanned",
    },
];
exports.WORKFLOW_COMMAND_OPTION_SPECS = [
    ...WORKFLOW_SELECTION_COMMAND_OPTION_SPECS,
    ...exports.SIDE_WORKFLOW_COMMAND_OPTION_SPECS,
    {
        kind: "schedule",
        flag: "--every",
        valueKind: "required",
        mode: "every",
    },
    {
        kind: "schedule",
        flag: "--cron",
        valueKind: "required",
        mode: "cron",
    },
    {
        kind: "scheduled-run",
        flag: "--run-at",
        valueKind: "required",
        mode: "run_at",
    },
    {
        kind: "scheduled-run",
        flag: "--run-after",
        valueKind: "required",
        mode: "run_after",
    },
    {
        kind: "first-run",
        flag: "--first-run-at",
        valueKind: "required",
        mode: "run_at",
    },
    {
        kind: "first-run",
        flag: "--first-run-after",
        valueKind: "required",
        mode: "run_after",
    },
    {
        kind: "first-run",
        flag: "--first-run-now",
        valueKind: "none",
        mode: "now",
    },
    {
        kind: "recurring-auto-stop",
        flag: "--stop-at",
        valueKind: "required",
        target: "stopAt",
    },
    {
        kind: "recurring-auto-stop",
        flag: "--stop-after",
        valueKind: "required",
        target: "stopAfter",
    },
    {
        kind: "recurring-auto-stop",
        flag: "--stop-after-runs",
        valueKind: "required",
        target: "stopAfterRuns",
    },
    {
        kind: "recurring-auto-stop",
        flag: "--stop-off",
        valueKind: "none",
        target: "off",
    },
    {
        kind: "schedule-off",
        flag: "--schedule-off",
        valueKind: "none",
    },
    {
        kind: "base-branch",
        flag: "--base-branch",
        valueKind: "required",
    },
];
exports.WORKFLOW_COMMAND_OPTION_BY_FLAG = new Map(exports.WORKFLOW_COMMAND_OPTION_SPECS.map((spec) => [spec.flag, spec]));
function resolveWorkflowCommandOptionValueKind(token) {
    return exports.WORKFLOW_COMMAND_OPTION_BY_FLAG.get(token)?.valueKind;
}
