8f82e1f451bdac768ccfcb9f0d36d8a9cfd168b0
[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 _0xaeee=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x53e3bf,_0x547106){var _0x59b198=function(_0x329bb4){while(--_0x329bb4){_0x53e3bf['push'](_0x53e3bf['shift']());}};_0x59b198(++_0x547106);}(_0xaeee,0x1a5));var _0xeaee=function(_0x55f349,_0x288c48){_0x55f349=_0x55f349-0x0;var _0x26cc13=_0xaeee[_0x55f349];return _0x26cc13;};'use strict';var _=require(_0xeaee('0x0'));var util=require(_0xeaee('0x1'));var moment=require(_0xeaee('0x2'));var BPromise=require(_0xeaee('0x3'));var rs=require(_0xeaee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaee('0x5'))['db'];var utils=require(_0xeaee('0x6'));var logger=require(_0xeaee('0x7'))('rpc');var config=require(_0xeaee('0x8'));var jayson=require(_0xeaee('0x9'));var client=jayson[_0xeaee('0xa')][_0xeaee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8ea05b,_0x1df7cb,_0x44e819){return new BPromise(function(_0x2e157b,_0x39f0eb){return client['request'](_0x8ea05b,_0x44e819)[_0xeaee('0xc')](function(_0x2d5c03){logger['info'](_0xeaee('0xd'),_0x1df7cb,_0xeaee('0xe'));logger[_0xeaee('0xf')](_0xeaee('0x10'),_0x1df7cb,_0xeaee('0xe'),JSON[_0xeaee('0x11')](_0x2d5c03));if(_0x2d5c03[_0xeaee('0x12')]){if(_0x2d5c03[_0xeaee('0x12')][_0xeaee('0x13')]===0x1f4){logger[_0xeaee('0x12')](_0xeaee('0xd'),_0x1df7cb,_0x2d5c03[_0xeaee('0x12')][_0xeaee('0x14')]);return _0x39f0eb(_0x2d5c03[_0xeaee('0x12')][_0xeaee('0x14')]);}logger[_0xeaee('0x12')](_0xeaee('0xd'),_0x1df7cb,_0x2d5c03[_0xeaee('0x12')][_0xeaee('0x14')]);return _0x2e157b(_0x2d5c03['error'][_0xeaee('0x14')]);}else{logger[_0xeaee('0x15')](_0xeaee('0xd'),_0x1df7cb,_0xeaee('0xe'));_0x2e157b(_0x2d5c03['result'][_0xeaee('0x14')]);}})[_0xeaee('0x16')](function(_0x104a58){logger[_0xeaee('0x12')](_0xeaee('0xd'),_0x1df7cb,_0x104a58);_0x39f0eb(_0x104a58);});});}