Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.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 _0x5c93=['path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','../../config/logger','moment','bluebird','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5c93,0x10c));var _0x35c9=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5c93[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x35c9('0x0'))('api');var moment=require(_0x35c9('0x1'));var BPromise=require(_0x35c9('0x2'));var rp=require(_0x35c9('0x3'));var fs=require('fs');var path=require(_0x35c9('0x4'));var rimraf=require(_0x35c9('0x5'));var config=require(_0x35c9('0x6'));var attributes=require(_0x35c9('0x7'));module[_0x35c9('0x8')]=function(_0x539941,_0x270a11){return _0x539941[_0x35c9('0x9')](_0x35c9('0xa'),attributes,{'tableName':_0x35c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x465943,_0x24abb0,_0x32a9e5){if(_0x465943[_0x35c9('0xc')](_0x35c9('0xd'))){_0x465943[_0x35c9('0xe')]=moment()[_0x35c9('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x32a9e5(null,_0x465943);}}});};