<commit_before>import * as bot from '../../bot/bot'
import * as express from 'express';

var default_address = {  
   "id":"1501719090455",     // not required - should we save anyway?
   "channelId":"msteams",
   "conversation":{  
      "isGroup":true,
      "id":"19:68b83f2c7ffd4b36bbbca0f16a4a097d<EMAIL>.skype"
   },
   "bot":{  
      "id":"28:bababc50-4dad-45b5-a10f-5b98129ccf1d",
      "name":"Jibe"
   },
   "serviceUrl":"https://smba.trafficmanager.net/amer-client-ss.msg/"
}

function send_card(req: express.Request, res: express.Response) {
    let address = req.body.address;
    let card = req.body.card;
    if (!address) {
        address = default_address;
        // If no address and no card parameter, try sending the whole request body as a card
        if (!card) {
            card = req.body;
        }
    }
    bot.sendActionableCard(address, card);
    res.status(200).send();
}

export {
    send_card as put,
}<commit_msg>allow /api/card to send actionable cards<commit_after>import * as bot from '../../bot/bot'
import * as express from 'express';

var default_address = {  
   "id":"1501719090455",     // not required - should we save anyway?
   "channelId":"msteams",
   "conversation":{  
      "isGroup":true,
      "id":"19:<EMAIL>"
   },
   "bot":{  
      "id":"28:bababc50-4dad-45b5-a10f-5b98129ccf1d",
      "name":"Jibe"
   },
   "serviceUrl":"https://smba.trafficmanager.net/amer-client-ss.msg/"
}

function send_card(req: express.Request, res: express.Response) {
    let address = req.body.address;
    let card = req.body.card;
    if (!address) {
        address = default_address;
        // If no address and no card parameter, try sending the whole request body as a card
        if (!card) {
            card = req.body;
        }
    }
    if (card.type === "AdaptiveCard") {
       bot.sendAdaptiveCard(address, card);
    } else {
       bot.sendActionableCard(address, card);
    }
    res.status(200).send();
}

export {
    send_card as put,
}
{'fraction_non_alphanumeric': 0.15092453773113443, 'fraction_numerical': 0.04297851074462768, 'mean_word_length': 2.6137184115523464, 'pattern_counts': {'":': 18, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5154383', 'n_tokens_mistral': 741, 'n_tokens_neox': 688, 'n_words': 149}