cont3xt/integration.js
/**
   * GET - /api/integration
   *
   * List out all the integrations. Integrations without any itypes are skipped.
   * @name /integration
   * @returns {Integrations[]} integrations - A map of integrations that the logged in user has configured
   * @returns {boolean} success - True if the request was successful, false otherwise
   */
/api/integration
List out all the integrations. Integrations without any itypes are skipped.
@name /integration
@returns {Integrations[]} integrations - A map of integrations that the logged in user has configured
@returns {boolean} success - True if the request was successful, false otherwise
/ api / integration List out all the integrations . Integrations without any itypes are skipped . @name / integration @returns { Integrations [] } integrations - A map of integrations that the logged in user has configured @returns { boolean } success - True if the request was successful false otherwise
static async apiList (req, res, next) {
    const results = {};
    const integrations = Integration.integrations.all;
    const keys = req.user.getCont3xtKeys();
    for (const integration of integrations) {
      if (Object.keys(integration.itypes).length === 0) { continue; }
      let doable = true;
      const disabled = keys?.[integration.name]?.disabled;
      if (disabled === true || disabled === 'true') {
        doable = false;
      }
      if (doable && integration.settings) {
        for (const setting in integration.settings) {
          if (integration.settings[setting].required && !integration.getUserConfig(req.user, integration.name, setting)) {
            doable = false;
            break;
          }
        }
      }
      let card = integration.card;
      const cardstr = integration.getUserConfig(req.user, integration.name, 'card');
      if (cardstr) {
        card = JSON.parse(cardstr);
      }
      const order = integration.getUserConfig(req.user, integration.name, 'order', integration.order);
      results[integration.name] = {
        doable: doable,
        cacheTimeout: integration.cacheable ? integration.cacheTimeout : -1,
        cachePolicy: integration.cachePolicy,
        icon: integration.icon,
        card: card,
        order: order
      };
    }
    return res.send({ success: true, integrations: results });
  }
static async apiList ( req , res , next ) { const results = { } ; const integrations = Integration . integrations . all ; const keys = req . user . getCont3xtKeys ( ) ; for ( const integration of integrations ) { if ( Object . keys ( integration . itypes ) . length === 0 ) { continue ; } let doable = true ; const disabled = keys ?. [ integration . name ] ?. disabled ; if ( disabled === true || disabled === 'true' ) { doable = false ; } if ( doable && integration . settings ) { for ( const setting in integration . settings ) { if ( integration . settings [ setting ] . required && ! integration . getUserConfig ( req . user , integration . name , setting ) ) { doable = false ; break ; } } } let card = integration . card ; const cardstr = integration . getUserConfig ( req . user , integration . name , 'card' ) ; if ( cardstr ) { card = JSON . parse ( cardstr ) ; } const order = integration . getUserConfig ( req . user , integration . name , 'order' , integration . order ) ; results [ integration . name ] = { doable : doable , cacheTimeout : integration . cacheable ? integration . cacheTimeout : - 1 , cachePolicy : integration . cachePolicy , icon : integration . icon , card : card , order : order } ; } return res . send ( { success : true , integrations : results } ) ; }
GET - /api/integration
 List out all the integrations.
GET - / api / integration List out all the integrations .
// First check if user has disabled integration // If still doable check to see if all settings set // User can override card display // Should normalize here // User can override order