Built motion from commit (unavailable).|2.4.0
[motion2.git] / server / api / mailSubstatus / mailSubstatus.rpc.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 _0x5f70=['../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','message','MailSubstatus,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x4637f0,_0x30443d){var _0x2ef2ae=function(_0x43f829){while(--_0x43f829){_0x4637f0['push'](_0x4637f0['shift']());}};_0x2ef2ae(++_0x30443d);}(_0x5f70,0xf2));var _0x05f7=function(_0x50567b,_0xe52247){_0x50567b=_0x50567b-0x0;var _0x123b8b=_0x5f70[_0x50567b];return _0x123b8b;};'use strict';var _=require(_0x05f7('0x0'));var util=require(_0x05f7('0x1'));var moment=require(_0x05f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05f7('0x3'));var db=require(_0x05f7('0x4'))['db'];var utils=require(_0x05f7('0x5'));var logger=require('../../config/logger')(_0x05f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x05f7('0x7'));var client=jayson[_0x05f7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1169,_0x178d7e,_0x57e2c7){return new BPromise(function(_0x4828e4,_0x4484ca){return client['request'](_0x3a1169,_0x57e2c7)[_0x05f7('0x9')](function(_0x344ce5){logger[_0x05f7('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x178d7e,_0x05f7('0xb'));logger[_0x05f7('0xc')](_0x05f7('0xd'),_0x178d7e,_0x05f7('0xb'),JSON['stringify'](_0x344ce5));if(_0x344ce5[_0x05f7('0xe')]){if(_0x344ce5[_0x05f7('0xe')]['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x178d7e,_0x344ce5[_0x05f7('0xe')]['message']);return _0x4484ca(_0x344ce5['error'][_0x05f7('0xf')]);}logger['error'](_0x05f7('0x10'),_0x178d7e,_0x344ce5[_0x05f7('0xe')][_0x05f7('0xf')]);return _0x4828e4(_0x344ce5['error'][_0x05f7('0xf')]);}else{logger[_0x05f7('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x178d7e,'request\x20sent');_0x4828e4(_0x344ce5[_0x05f7('0x11')][_0x05f7('0xf')]);}})[_0x05f7('0x12')](function(_0x1c056f){logger[_0x05f7('0xe')](_0x05f7('0x10'),_0x178d7e,_0x1c056f);_0x4484ca(_0x1c056f);});});}