
import { localize } from '../../../../nls.js';

const idDescription = ( localize(
    16788,
    "The input's id is used to associate an input with a variable of the form ${input:id}."
));
const typeDescription = ( localize(16789, "The type of user input prompt to use."));
const descriptionDescription = ( localize(16790, "The description is shown when the user is prompted for input."));
const defaultDescription = ( localize(16791, "The default value for the input."));
const inputsSchema = {
    definitions: {
        inputs: {
            type: "array",
            description: ( localize(
                16792,
                "User inputs. Used for defining user input prompts, such as free string input or a choice from several options."
            )),
            items: {
                oneOf: [{
                    type: "object",
                    required: ["id", "type", "description"],
                    additionalProperties: false,
                    properties: {
                        id: {
                            type: "string",
                            description: idDescription
                        },
                        type: {
                            type: "string",
                            description: typeDescription,
                            enum: ["promptString"],
                            enumDescriptions: [( localize(
                                16793,
                                "The 'promptString' type opens an input box to ask the user for input."
                            ))]
                        },
                        description: {
                            type: "string",
                            description: descriptionDescription
                        },
                        default: {
                            type: "string",
                            description: defaultDescription
                        },
                        password: {
                            type: "boolean",
                            description: ( localize(
                                16794,
                                "Controls if a password input is shown. Password input hides the typed text."
                            ))
                        }
                    }
                }, {
                    type: "object",
                    required: ["id", "type", "description", "options"],
                    additionalProperties: false,
                    properties: {
                        id: {
                            type: "string",
                            description: idDescription
                        },
                        type: {
                            type: "string",
                            description: typeDescription,
                            enum: ["pickString"],
                            enumDescriptions: [( localize(16795, "The 'pickString' type shows a selection list."))]
                        },
                        description: {
                            type: "string",
                            description: descriptionDescription
                        },
                        default: {
                            type: "string",
                            description: defaultDescription
                        },
                        options: {
                            type: "array",
                            description: ( localize(16796, "An array of strings that defines the options for a quick pick.")),
                            items: {
                                oneOf: [{
                                    type: "string"
                                }, {
                                    type: "object",
                                    required: ["value"],
                                    additionalProperties: false,
                                    properties: {
                                        label: {
                                            type: "string",
                                            description: ( localize(16797, "Label for the option."))
                                        },
                                        value: {
                                            type: "string",
                                            description: ( localize(16798, "Value for the option."))
                                        }
                                    }
                                }]
                            }
                        }
                    }
                }, {
                    type: "object",
                    required: ["id", "type", "command"],
                    additionalProperties: false,
                    properties: {
                        id: {
                            type: "string",
                            description: idDescription
                        },
                        type: {
                            type: "string",
                            description: typeDescription,
                            enum: ["command"],
                            enumDescriptions: [( localize(16799, "The 'command' type executes a command."))]
                        },
                        command: {
                            type: "string",
                            description: ( localize(16800, "The command to execute for this input variable."))
                        },
                        args: {
                            oneOf: [{
                                type: "object",
                                description: ( localize(16801, "Optional arguments passed to the command."))
                            }, {
                                type: "array",
                                description: ( localize(16801, "Optional arguments passed to the command."))
                            }, {
                                type: "string",
                                description: ( localize(16801, "Optional arguments passed to the command."))
                            }]
                        }
                    }
                }]
            }
        }
    }
};

export { inputsSchema };
