<commit_before>'use strict';

var uuid = require("uuid");
var merge = require("lodash.merge");
var forEach = require("lodash.foreach");

// @param {Object} event
// @returns {Object}
function incomingAuthentication(event) {
  return {
    message: {
      distinct_id: '...',
      mtype: 'event',
      properties: {
        type: 'optin',
        ref: event.optin.ref
      }
    }
  };
}

// @param {Object} event
// @returns {Object}
function incomingQuickReply(event) {
  return {
    message: {
      distinct_id: event.message.mid,
      mtype: 'quick_reply',
      properties: {
        text: event.message.quick_reply.payload
      }
    }
  };
}

// @param {Object} event
// @returns {Object}
function incomingAttachment(event) {
  return {
    message: {
      distinct_id: event.message.mid,
      mtype: event.message.payload.type,
      properties: {
        url: event.message.payload.url
      }
    }
  };
}

// @param {Object} event
// @returns {Object}
function incomingText(event) {<commit_msg>Fix incoming attachment schema<commit_after>'use strict';

var uuid = require("uuid");
var merge = require("lodash.merge");
var forEach = require("lodash.foreach");

// @param {Object} event
// @returns {Object}
function incomingAuthentication(event) {
  return {
    message: {
      distinct_id: '...',
      mtype: 'event',
      properties: {
        type: 'optin',
        ref: event.optin.ref
      }
    }
  };
}

// @param {Object} event
// @returns {Object}
function incomingQuickReply(event) {
  return {
    message: {
      distinct_id: event.message.mid,
      mtype: 'quick_reply',
      properties: {
        text: event.message.quick_reply.payload
      }
    }
  };
}

// @param {Object} event
// @returns {Object}
function incomingAttachment(event) {
  var attachment = event.message.attachments[0];

  return {
    message: {
      distinct_id: event.message.mid,
      mtype: attachment.type,
      properties: {
        url: attachment.payload.url
      }
    }
  };
}

// @param {Object} event
// @returns {Object}
function incomingText(event) {
{'fraction_non_alphanumeric': 0.14656415185007207, 'fraction_numerical': 0.0004805382027871216, 'mean_word_length': 2.602076124567474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3275933', 'n_tokens_mistral': 659, 'n_tokens_neox': 663, 'n_words': 140}