Built motion from commit 67e5df37.|2.0.66
[motion2.git] / server / api / chatOfflineMessage / chatOfflineMessage.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 _0xb184=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xb184,0x14e));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b18('0x0'));var util=require(_0x4b18('0x1'));var moment=require(_0x4b18('0x2'));var BPromise=require(_0x4b18('0x3'));var rs=require(_0x4b18('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x4b18('0x5'));var logger=require(_0x4b18('0x6'))(_0x4b18('0x7'));var config=require(_0x4b18('0x8'));var jayson=require(_0x4b18('0x9'));var client=jayson[_0x4b18('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481827,_0x32891b,_0x8cef11){return new BPromise(function(_0x19e78f,_0x26810f){return client[_0x4b18('0xb')](_0x481827,_0x8cef11)[_0x4b18('0xc')](function(_0x58182f){logger[_0x4b18('0xd')](_0x4b18('0xe'),_0x32891b,_0x4b18('0xf'));logger[_0x4b18('0x10')](_0x4b18('0x11'),_0x32891b,_0x4b18('0xf'),JSON[_0x4b18('0x12')](_0x58182f));if(_0x58182f[_0x4b18('0x13')]){if(_0x58182f[_0x4b18('0x13')][_0x4b18('0x14')]===0x1f4){logger[_0x4b18('0x13')](_0x4b18('0xe'),_0x32891b,_0x58182f[_0x4b18('0x13')][_0x4b18('0x15')]);return _0x26810f(_0x58182f[_0x4b18('0x13')]['message']);}logger[_0x4b18('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32891b,_0x58182f[_0x4b18('0x13')][_0x4b18('0x15')]);return _0x19e78f(_0x58182f[_0x4b18('0x13')][_0x4b18('0x15')]);}else{logger[_0x4b18('0xd')](_0x4b18('0xe'),_0x32891b,'request\x20sent');_0x19e78f(_0x58182f[_0x4b18('0x16')][_0x4b18('0x15')]);}})[_0x4b18('0x17')](function(_0x4f6f8a){logger[_0x4b18('0x13')](_0x4b18('0xe'),_0x32891b,_0x4f6f8a);_0x26810f(_0x4f6f8a);});});}