import { getBasePluginId } from './integration.js';
// TODO: Do we need this field in the FE?
export var PluginType;
(function (PluginType) {
    PluginType["DB"] = "DB";
    PluginType["API"] = "API";
    PluginType["JS"] = "JS";
    PluginType["CODE"] = "CODE";
})(PluginType || (PluginType = {}));
export var PluginResponseType;
(function (PluginResponseType) {
    PluginResponseType["TABLE"] = "TABLE";
    PluginResponseType["JSON"] = "JSON";
})(PluginResponseType || (PluginResponseType = {}));
// This is a plugin version which is guaranteed to be earliest in any plugin.
export const VERSION_INITIAL = '0.0.1';
export var RestApiBodyDataType;
(function (RestApiBodyDataType) {
    RestApiBodyDataType["JSON"] = "jsonBody";
    RestApiBodyDataType["RAW"] = "rawBody";
    RestApiBodyDataType["FORM"] = "formData";
    RestApiBodyDataType["FILE_FORM"] = "fileForm";
})(RestApiBodyDataType || (RestApiBodyDataType = {}));
export var RestApiFields;
(function (RestApiFields) {
    RestApiFields["HEADERS"] = "headers";
    RestApiFields["PARAMS"] = "params";
    RestApiFields["FILE_FORM_KEY"] = "fileFormKey";
    RestApiFields["FILE_NAME"] = "fileName";
    RestApiFields["BODY"] = "body";
    RestApiFields["BODY_TYPE"] = "bodyType";
    RestApiFields["FORM_DATA"] = "formData";
    RestApiFields["PATH"] = "path";
    RestApiFields["HTTP_METHOD"] = "httpMethod";
    RestApiFields["URL_BASE"] = "urlBase";
    RestApiFields["URL_PATH"] = "urlPath";
    RestApiFields["AUTH_TYPE"] = "authType";
    RestApiFields["RESPONSE_TYPE"] = "responseType";
    RestApiFields["OPENAPI_TENANT_NAME"] = "openApiTenantName";
    RestApiFields["VERBOSE_HTTP_OUTPUT"] = "verboseHttpOutput";
    RestApiFields["DO_NOT_FAIL_ON_REQUEST_ERROR"] = "doNotFailOnRequestError";
})(RestApiFields || (RestApiFields = {}));
const restApiFieldDisplayName = new Map([
    [RestApiFields.HEADERS, 'Headers'],
    [RestApiFields.PARAMS, 'Parameters'],
    [RestApiFields.FILE_FORM_KEY, 'File form key'],
    [RestApiFields.FILE_NAME, 'File name'],
    [RestApiFields.BODY_TYPE, 'Body content type'],
    [RestApiFields.FORM_DATA, 'Form data'],
    [RestApiFields.PATH, 'URL'],
    [RestApiFields.HTTP_METHOD, 'Method'],
    [RestApiFields.URL_BASE, 'Base URL'],
    [RestApiFields.URL_PATH, 'URL path'],
    [RestApiFields.AUTH_TYPE, 'Authentication'],
    [RestApiFields.RESPONSE_TYPE, 'Response type'],
    [RestApiFields.OPENAPI_TENANT_NAME, 'Tenant name'],
    [RestApiFields.VERBOSE_HTTP_OUTPUT, 'Include full request response in step output'],
    [RestApiFields.DO_NOT_FAIL_ON_REQUEST_ERROR, 'Fail if the request returns a 4** or 5** status code']
]);
export const getRestApiFieldDisplayName = function (field) {
    return restApiFieldDisplayName.get(field) ?? '';
};
const restApiDataTypeDisplayName = new Map([
    [RestApiBodyDataType.JSON, 'JSON'],
    [RestApiBodyDataType.FORM, 'Form'],
    [RestApiBodyDataType.FILE_FORM, 'File Form'],
    [RestApiBodyDataType.RAW, 'Raw']
]);
export const getRestApiDataTypeDisplayName = function (dataType) {
    return restApiDataTypeDisplayName.get(dataType) ?? '';
};
const restApiBodyLabel = new Map([
    [RestApiBodyDataType.JSON, 'JSON Body'],
    [RestApiBodyDataType.FORM, 'Form Data'],
    [RestApiBodyDataType.FILE_FORM, 'File Contents'],
    [RestApiBodyDataType.RAW, 'Raw Data']
]);
export const getRestApiBodyLabel = function (dataType) {
    return restApiBodyLabel.get(dataType) ?? '';
};
export const getPluginExecutionVersion = (pluginExecutionVersions, pluginId) => {
    return pluginExecutionVersions[getBasePluginId(pluginId)];
};
export const setPluginExecutionVersion = (pluginExecutionVersions, pluginId, pluginVersion) => {
    pluginExecutionVersions[getBasePluginId(pluginId)] = pluginVersion;
};
export var IntegrationKind;
(function (IntegrationKind) {
    IntegrationKind["SECRET"] = "SECRET";
    IntegrationKind["PLUGIN"] = "PLUGIN";
})(IntegrationKind || (IntegrationKind = {}));
export * from './form.js';
export * from './language.js';
export * from './evaluation.js';
export * from './integration.js';
//# sourceMappingURL=index.js.map