<commit_before>const express = require('express')
const router = express.Router()
const User = require('../db/models/user')
const Message = require('../db/models/message')
const Oauth = require('../db/models/oauth')
// const passport = require('passport')
const axios = require('axios')
const google = require('googleapis')
const Gmail = require('node-gmail-api')
const Promise = require('bluebird')
const simpleParser = require('mailparser').simpleParser


// const loadContacts = require('../util/loadContacts')
// const loadMessages = require('../util/loadMessages')


// iMESSAGE DB / get all contacts

router.get('/', function (req, res, next){

let newContacts<commit_msg>feat(contacts): Can create contacts onto Heroku database.. maybe<commit_after>const express = require('express')
const router = express.Router()
const User = require('../db/models/user')
const Message = require('../db/models/message')
const Oauth = require('../db/models/oauth')
// const passport = require('passport')
const axios = require('axios')
const google = require('googleapis')
const Gmail = require('node-gmail-api')
const Promise = require('bluebird')
const simpleParser = require('mailparser').simpleParser


// const loadContacts = require('../util/loadContacts')
// const loadMessages = require('../util/loadMessages')


// iMESSAGE DB / get all contacts

router.post('/', (req, res, next) => {
	const contacts = req.body
	const ourUser = req.user

	return Promise.all(contacts.map(elem => {

		if (elem.ZFULLNUMBER) {
			return User.findOrCreate(
				{
					defaults: { ZFIRSTNAME: elem.ZFIRSTNAME, ZLASTNAME: elem.ZLASTNAME, ZFULLNUMBER: elem.ZFULLNUMBER },
					where: { ZFULLNUMBER: elem.ZFULLNUMBER.replace(/[^0-9]/g, '').slice(-10) }
				}
			)
		}

	})) //closes the Promise.all
		.then((allCreatedContacts) => {
			console.log('=====Finished Syncing Contacts====')
	})
})

router.get('/', function (req, res, next){

let newContacts
{'fraction_non_alphanumeric': 0.17028985507246377, 'fraction_numerical': 0.002070393374741201, 'mean_word_length': 4.475920679886686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3261439', 'n_tokens_mistral': 618, 'n_tokens_neox': 577, 'n_words': 142}