"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IntegrationKind = exports.setPluginExecutionVersion = exports.getPluginExecutionVersion = exports.getRestApiBodyLabel = exports.getRestApiDataTypeDisplayName = exports.getRestApiFieldDisplayName = exports.RestApiFields = exports.RestApiBodyDataType = exports.VERSION_INITIAL = exports.PluginResponseType = exports.PluginType = void 0;
const integration_js_1 = require("./integration.js");
// TODO: Do we need this field in the FE?
var PluginType;
(function (PluginType) {
    PluginType["DB"] = "DB";
    PluginType["API"] = "API";
    PluginType["JS"] = "JS";
    PluginType["CODE"] = "CODE";
})(PluginType || (exports.PluginType = PluginType = {}));
var PluginResponseType;
(function (PluginResponseType) {
    PluginResponseType["TABLE"] = "TABLE";
    PluginResponseType["JSON"] = "JSON";
})(PluginResponseType || (exports.PluginResponseType = PluginResponseType = {}));
// This is a plugin version which is guaranteed to be earliest in any plugin.
exports.VERSION_INITIAL = '0.0.1';
var RestApiBodyDataType;
(function (RestApiBodyDataType) {
    RestApiBodyDataType["JSON"] = "jsonBody";
    RestApiBodyDataType["RAW"] = "rawBody";
    RestApiBodyDataType["FORM"] = "formData";
    RestApiBodyDataType["FILE_FORM"] = "fileForm";
})(RestApiBodyDataType || (exports.RestApiBodyDataType = RestApiBodyDataType = {}));
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 || (exports.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']
]);
const getRestApiFieldDisplayName = function (field) {
    return restApiFieldDisplayName.get(field) ?? '';
};
exports.getRestApiFieldDisplayName = getRestApiFieldDisplayName;
const restApiDataTypeDisplayName = new Map([
    [RestApiBodyDataType.JSON, 'JSON'],
    [RestApiBodyDataType.FORM, 'Form'],
    [RestApiBodyDataType.FILE_FORM, 'File Form'],
    [RestApiBodyDataType.RAW, 'Raw']
]);
const getRestApiDataTypeDisplayName = function (dataType) {
    return restApiDataTypeDisplayName.get(dataType) ?? '';
};
exports.getRestApiDataTypeDisplayName = getRestApiDataTypeDisplayName;
const restApiBodyLabel = new Map([
    [RestApiBodyDataType.JSON, 'JSON Body'],
    [RestApiBodyDataType.FORM, 'Form Data'],
    [RestApiBodyDataType.FILE_FORM, 'File Contents'],
    [RestApiBodyDataType.RAW, 'Raw Data']
]);
const getRestApiBodyLabel = function (dataType) {
    return restApiBodyLabel.get(dataType) ?? '';
};
exports.getRestApiBodyLabel = getRestApiBodyLabel;
const getPluginExecutionVersion = (pluginExecutionVersions, pluginId) => {
    return pluginExecutionVersions[(0, integration_js_1.getBasePluginId)(pluginId)];
};
exports.getPluginExecutionVersion = getPluginExecutionVersion;
const setPluginExecutionVersion = (pluginExecutionVersions, pluginId, pluginVersion) => {
    pluginExecutionVersions[(0, integration_js_1.getBasePluginId)(pluginId)] = pluginVersion;
};
exports.setPluginExecutionVersion = setPluginExecutionVersion;
var IntegrationKind;
(function (IntegrationKind) {
    IntegrationKind["SECRET"] = "SECRET";
    IntegrationKind["PLUGIN"] = "PLUGIN";
})(IntegrationKind || (exports.IntegrationKind = IntegrationKind = {}));
__exportStar(require("./form.js"), exports);
__exportStar(require("./language.js"), exports);
__exportStar(require("./evaluation.js"), exports);
__exportStar(require("./integration.js"), exports);
//# sourceMappingURL=index.js.map