Built motion from commit (unavailable).|2.5.14
[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 _0x745c=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x745c,0xb0));var _0xc745=function(_0x53fb63,_0x2497b0){_0x53fb63=_0x53fb63-0x0;var _0x3fd488=_0x745c[_0x53fb63];return _0x3fd488;};'use strict';var _=require('lodash');var util=require(_0xc745('0x0'));var moment=require(_0xc745('0x1'));var BPromise=require(_0xc745('0x2'));var rs=require(_0xc745('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc745('0x4'))['db'];var utils=require(_0xc745('0x5'));var logger=require(_0xc745('0x6'))('rpc');var config=require(_0xc745('0x7'));var jayson=require(_0xc745('0x8'));var client=jayson[_0xc745('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c0bc,_0xe49c8b,_0x363e67){return new BPromise(function(_0x4bc2dd,_0x3937d9){return client['request'](_0x4c0bc,_0x363e67)[_0xc745('0xa')](function(_0x3403ec){logger[_0xc745('0xb')](_0xc745('0xc'),_0xe49c8b,_0xc745('0xd'));logger[_0xc745('0xe')](_0xc745('0xf'),_0xe49c8b,'request\x20sent',JSON['stringify'](_0x3403ec));if(_0x3403ec['error']){if(_0x3403ec[_0xc745('0x10')][_0xc745('0x11')]===0x1f4){logger[_0xc745('0x10')](_0xc745('0xc'),_0xe49c8b,_0x3403ec[_0xc745('0x10')][_0xc745('0x12')]);return _0x3937d9(_0x3403ec[_0xc745('0x10')][_0xc745('0x12')]);}logger[_0xc745('0x10')](_0xc745('0xc'),_0xe49c8b,_0x3403ec[_0xc745('0x10')][_0xc745('0x12')]);return _0x4bc2dd(_0x3403ec['error'][_0xc745('0x12')]);}else{logger[_0xc745('0xb')](_0xc745('0xc'),_0xe49c8b,'request\x20sent');_0x4bc2dd(_0x3403ec[_0xc745('0x13')][_0xc745('0x12')]);}})[_0xc745('0x14')](function(_0x5ab729){logger[_0xc745('0x10')](_0xc745('0xc'),_0xe49c8b,_0x5ab729);_0x3937d9(_0x5ab729);});});}