export const GRAPHQL_BASE_PLUGIN_ID = 'graphql';
export const REST_API_BASE_PLUGIN_ID = 'restapi';
const SALESFORCE_PLUGIN_ID = 'salesforce';
export const SUPERBLOCKS_OPENAPI_TENANT_KEYWORD = '{SUPERBLOCKS_OPENAPI_TENANT_NAME}';
export var ExtendedIntegrationPluginId;
(function (ExtendedIntegrationPluginId) {
    ExtendedIntegrationPluginId["GRAPHQL"] = "graphqlintegration";
    ExtendedIntegrationPluginId["REST_API"] = "restapiintegration";
    // Native OpenAPI-backed integrations
    ExtendedIntegrationPluginId["AIRTABLE"] = "airtable";
    ExtendedIntegrationPluginId["ASANA"] = "asana";
    ExtendedIntegrationPluginId["BITBUCKET"] = "bitbucket";
    ExtendedIntegrationPluginId["BOX"] = "box";
    ExtendedIntegrationPluginId["CONFLUENCE"] = "confluence";
    ExtendedIntegrationPluginId["DROPBOX"] = "dropbox";
    ExtendedIntegrationPluginId["GITHUB"] = "github";
    ExtendedIntegrationPluginId["HUBSPOT"] = "hubspot";
    ExtendedIntegrationPluginId["NOTION"] = "notion";
    ExtendedIntegrationPluginId["PAGERDUTY"] = "pagerduty";
    ExtendedIntegrationPluginId["SEGMENT"] = "segment";
    ExtendedIntegrationPluginId["SENDGRID"] = "sendgrid";
    ExtendedIntegrationPluginId["SLACK"] = "slack";
    ExtendedIntegrationPluginId["SALESFORCE"] = "salesforce";
    ExtendedIntegrationPluginId["FRONT"] = "front";
    ExtendedIntegrationPluginId["ELASTICSEARCH"] = "elasticsearch";
    ExtendedIntegrationPluginId["JIRA"] = "jira";
    ExtendedIntegrationPluginId["ZENDESK"] = "zendesk";
    ExtendedIntegrationPluginId["TWILIO"] = "twilio";
    ExtendedIntegrationPluginId["CIRCLECI"] = "circleci";
    ExtendedIntegrationPluginId["LAUNCHDARKLY"] = "launchdarkly";
    ExtendedIntegrationPluginId["DATADOG"] = "datadog";
    ExtendedIntegrationPluginId["INTERCOM"] = "intercom";
    ExtendedIntegrationPluginId["ZOOM"] = "zoom";
    ExtendedIntegrationPluginId["GOOGLE_DRIVE"] = "googledrive";
    ExtendedIntegrationPluginId["GOOGLE_ANALYTICS"] = "googleanalytics";
    ExtendedIntegrationPluginId["STRIPE"] = "stripe";
    ExtendedIntegrationPluginId["ANTHROPIC"] = "anthropic";
    ExtendedIntegrationPluginId["GROQ"] = "groq";
    ExtendedIntegrationPluginId["MISTRAL"] = "mistral";
    ExtendedIntegrationPluginId["PERPLEXITY"] = "perplexity";
    ExtendedIntegrationPluginId["FIREWORKS"] = "fireworks";
    ExtendedIntegrationPluginId["STABILITYAI"] = "stabilityai";
    ExtendedIntegrationPluginId["COHERE"] = "cohere";
    ExtendedIntegrationPluginId["GEMINI"] = "gemini";
    ExtendedIntegrationPluginId["OPENAI_V2"] = "openai_v2";
    ExtendedIntegrationPluginId["SNOWFLAKE_CORTEX"] = "snowflakecortex";
    // Not native OpenAPI-backed integrations, but leveraging the same auth system
    ExtendedIntegrationPluginId["GOOGLE_SHEETS_PLUGIN_ID"] = "gsheets";
    ExtendedIntegrationPluginId["SNOWFLAKE"] = "snowflake";
    ExtendedIntegrationPluginId["DATABRICKS"] = "databricks";
    ExtendedIntegrationPluginId["LAKEBASE"] = "lakebase";
})(ExtendedIntegrationPluginId || (ExtendedIntegrationPluginId = {}));
// Note that we cannot import the plugins themselves to reference the id as
// that causes a cyclical import.
export const ExtendedIntegrationPluginMap = {
    [ExtendedIntegrationPluginId.GRAPHQL]: GRAPHQL_BASE_PLUGIN_ID,
    [ExtendedIntegrationPluginId.REST_API]: ExtendedIntegrationPluginId.REST_API,
    // Native OpenAPI-backed integrations
    [ExtendedIntegrationPluginId.AIRTABLE]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.ASANA]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.BITBUCKET]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.BOX]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.CONFLUENCE]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.DROPBOX]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.GITHUB]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.HUBSPOT]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.NOTION]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.PAGERDUTY]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.SEGMENT]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.SENDGRID]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.SLACK]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.SALESFORCE]: SALESFORCE_PLUGIN_ID,
    [ExtendedIntegrationPluginId.TWILIO]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.CIRCLECI]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.LAUNCHDARKLY]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.DATADOG]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.FRONT]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.ELASTICSEARCH]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.INTERCOM]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.ZOOM]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.GOOGLE_DRIVE]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.GOOGLE_ANALYTICS]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.JIRA]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.STRIPE]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.ZENDESK]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.ANTHROPIC]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.GROQ]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.MISTRAL]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.PERPLEXITY]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.FIREWORKS]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.STABILITYAI]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.COHERE]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.GEMINI]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.OPENAI_V2]: ExtendedIntegrationPluginId.REST_API,
    [ExtendedIntegrationPluginId.SNOWFLAKE_CORTEX]: ExtendedIntegrationPluginId.REST_API
};
export const EXTENDED_INTEGRATION_PLUGIN_IDS = Object.values(ExtendedIntegrationPluginId).map((val) => val);
export const pluginRequiresPersistedApiFetch = (pluginId = '') => {
    return !pluginId ? false : EXTENDED_INTEGRATION_PLUGIN_IDS.includes(pluginId);
};
export const isEnrichablePlugin = (pluginId = '') => {
    return EXTENDED_INTEGRATION_PLUGIN_IDS.includes(pluginId);
};
// This function returns the appropriate plugin ID to use for the
// specified plugin ID. This is done specifically to handle integrations
// that are leveraging the same plugin package as a default plugin.
// For now, this is true for GraphQLIntegrationPlugin and GraphQLPlugin, as well
// as OpenAPI plugins that are backed by RestApiIntegrationPlugin.
// DEFER TODO(taha) Eventually use restapi as the base for restapiintegration
export const getBasePluginId = (pluginId = '') => {
    return ExtendedIntegrationPluginMap[pluginId] ?? pluginId;
};
export const extendsRestApiIntegrationPlugin = (pluginId = '') => {
    return getBasePluginId(pluginId) === ExtendedIntegrationPluginId.REST_API;
};
export const extendsAnyApiIntegrationPlugin = (pluginId = '') => {
    return (getBasePluginId(pluginId) === ExtendedIntegrationPluginId.REST_API ||
        pluginId === ExtendedIntegrationPluginId.GRAPHQL ||
        pluginId === ExtendedIntegrationPluginId.SNOWFLAKE ||
        pluginId === ExtendedIntegrationPluginId.DATABRICKS ||
        pluginId === ExtendedIntegrationPluginId.LAKEBASE);
};
export const shouldInjectAuthHeaders = (pluginId = '') => {
    return (getBasePluginId(pluginId) === ExtendedIntegrationPluginId.REST_API &&
        pluginId !== ExtendedIntegrationPluginId.REST_API &&
        pluginId !== ExtendedIntegrationPluginId.GRAPHQL);
};
//# sourceMappingURL=integration.js.map