"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLPlugin = exports.GraphQLPluginVersions = void 0;
const index_js_1 = require("../../types/index.js");
const constants_js_1 = require("./constants.js");
exports.GraphQLPluginVersions = {
    V1: '0.0.1',
    V8: '0.0.8',
    V9: '0.0.9',
    V10: '0.0.10'
};
exports.GraphQLPlugin = {
    id: index_js_1.GRAPHQL_BASE_PLUGIN_ID,
    name: 'GraphQL',
    moduleName: 'GraphQLPlugin',
    modulePath: 'plugins/graphql/GraphQLPlugin',
    iconLocation: `${constants_js_1.PUBLIC_INTEGRATIONS_LOGO_URL}/graphql.png`,
    docsUrl: `${constants_js_1.DOCS_BASE_URL}/graphql`,
    type: index_js_1.PluginType.API,
    responseType: index_js_1.PluginResponseType.JSON,
    hasRawRequest: true,
    rawRequestName: 'Executed request',
    datasourceTemplate: {
        sections: []
    },
    actionTemplate: {
        sections: [
            {
                name: 'main',
                items: [
                    {
                        label: 'URL',
                        name: 'path',
                        startVersion: exports.GraphQLPluginVersions.V1,
                        componentType: index_js_1.FormComponentType.DYNAMIC_INPUT_TEXT,
                        placeholder: 'https://www.example.com/api?filter={{Dropdown1.selectedOptionValue}}',
                        rules: [{ required: true, message: 'URL is required' }]
                    }
                ]
            },
            {
                name: 'tabs',
                layout: index_js_1.FormSectionLayout.TABS,
                items: [
                    {
                        label: 'Query',
                        name: 'body',
                        startVersion: exports.GraphQLPluginVersions.V1,
                        componentType: index_js_1.FormComponentType.CODE_EDITOR,
                        language: index_js_1.EditorLanguage.JSON
                    },
                    {
                        label: 'Variables',
                        name: 'custom.variables.value',
                        startVersion: exports.GraphQLPluginVersions.V1,
                        componentType: index_js_1.FormComponentType.CODE_EDITOR,
                        language: index_js_1.EditorLanguage.JSON
                    },
                    {
                        label: 'Headers',
                        name: 'headers',
                        startVersion: exports.GraphQLPluginVersions.V1,
                        componentType: index_js_1.FormComponentType.FIELD_LIST,
                        initialValue: [
                            { key: 'Content-Type', value: 'application/json' },
                            { key: '', value: '' }
                        ]
                    }
                ]
            },
            {
                name: 'additionalSettings',
                sectionHeader: 'Additional Settings',
                isCollapsible: true,
                defaultCollapsed: true,
                asTitle: false,
                items: [
                    {
                        name: 'verboseHttpOutput',
                        label: 'Include full request response in step output',
                        lightLabelText: true,
                        startVersion: exports.GraphQLPluginVersions.V9,
                        componentType: index_js_1.FormComponentType.SWITCH,
                        initialValue: false,
                        showConfirm: false,
                        renderIconFirst: true
                    },
                    {
                        name: 'failOnGraphqlErrors',
                        label: 'Fail when request includes errors',
                        lightLabelText: true,
                        startVersion: exports.GraphQLPluginVersions.V10,
                        componentType: index_js_1.FormComponentType.SWITCH,
                        initialValue: false,
                        showConfirm: false,
                        renderIconFirst: true
                    }
                ]
            }
        ]
    },
    demoData: {
        path: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
        body: `query {
  allFilms {
    films {
      title
    }
  }
}`
    }
};
//# sourceMappingURL=graphql.js.map