Built motion from commit (unavailable).|2.5.26
[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 _0x192e=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x454e6d,_0x1e1f38){var _0x4bc294=function(_0x2c803a){while(--_0x2c803a){_0x454e6d['push'](_0x454e6d['shift']());}};_0x4bc294(++_0x1e1f38);}(_0x192e,0x118));var _0xe192=function(_0x32b81a,_0x58e722){_0x32b81a=_0x32b81a-0x0;var _0x38a52a=_0x192e[_0x32b81a];return _0x38a52a;};'use strict';var _=require(_0xe192('0x0'));var util=require(_0xe192('0x1'));var moment=require('moment');var BPromise=require(_0xe192('0x2'));var rs=require(_0xe192('0x3'));var fs=require('fs');var Redis=require(_0xe192('0x4'));var db=require(_0xe192('0x5'))['db'];var utils=require(_0xe192('0x6'));var logger=require(_0xe192('0x7'))('rpc');var config=require(_0xe192('0x8'));var jayson=require(_0xe192('0x9'));var client=jayson[_0xe192('0xa')][_0xe192('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40c004,_0x1cc425,_0x2c63d9){return new BPromise(function(_0x236834,_0x53019a){return client[_0xe192('0xc')](_0x40c004,_0x2c63d9)[_0xe192('0xd')](function(_0x36d897){logger['info'](_0xe192('0xe'),_0x1cc425,_0xe192('0xf'));logger['debug'](_0xe192('0x10'),_0x1cc425,'request\x20sent',JSON['stringify'](_0x36d897));if(_0x36d897[_0xe192('0x11')]){if(_0x36d897[_0xe192('0x11')][_0xe192('0x12')]===0x1f4){logger[_0xe192('0x11')](_0xe192('0xe'),_0x1cc425,_0x36d897[_0xe192('0x11')][_0xe192('0x13')]);return _0x53019a(_0x36d897[_0xe192('0x11')][_0xe192('0x13')]);}logger['error'](_0xe192('0xe'),_0x1cc425,_0x36d897[_0xe192('0x11')]['message']);return _0x236834(_0x36d897[_0xe192('0x11')]['message']);}else{logger[_0xe192('0x14')](_0xe192('0xe'),_0x1cc425,'request\x20sent');_0x236834(_0x36d897['result'][_0xe192('0x13')]);}})['catch'](function(_0x202dce){logger[_0xe192('0x11')](_0xe192('0xe'),_0x1cc425,_0x202dce);_0x53019a(_0x202dce);});});}