Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.model.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x1e33=['./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9c2b18,_0x21a082){var _0x2afc7b=function(_0x3ae826){while(--_0x3ae826){_0x9c2b18['push'](_0x9c2b18['shift']());}};_0x2afc7b(++_0x21a082);}(_0x1e33,0x13d));var _0x31e3=function(_0x3104d7,_0x197001){_0x3104d7=_0x3104d7-0x0;var _0x9917b5=_0x1e33[_0x3104d7];return _0x9917b5;};'use strict';var _=require('lodash');var util=require(_0x31e3('0x0'));var logger=require('../../config/logger')(_0x31e3('0x1'));var moment=require(_0x31e3('0x2'));var BPromise=require(_0x31e3('0x3'));var rp=require(_0x31e3('0x4'));var fs=require('fs');var path=require(_0x31e3('0x5'));var rimraf=require(_0x31e3('0x6'));var config=require('../../config/environment');var attributes=require(_0x31e3('0x7'));module[_0x31e3('0x8')]=function(_0x500d96,_0x92d309){return _0x500d96[_0x31e3('0x9')](_0x31e3('0xa'),attributes,{'tableName':_0x31e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x31e3('0xc'),'hooks':{'beforeUpdate':function(_0x1793a1,_0x32a5fe,_0x470a1b){if(_0x1793a1[_0x31e3('0xd')](_0x31e3('0xe'))){_0x1793a1[_0x31e3('0xf')]=moment()[_0x31e3('0x10')](_0x31e3('0x11'));}_0x470a1b(null,_0x1793a1);}}});};