Built motion from commit (unavailable).|2.4.4
[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 _0x58be=['client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2da050,_0x2e47c9){var _0x10ffd1=function(_0x3aac10){while(--_0x3aac10){_0x2da050['push'](_0x2da050['shift']());}};_0x10ffd1(++_0x2e47c9);}(_0x58be,0xd3));var _0xe58b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x58be[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe58b('0x0'));var util=require(_0xe58b('0x1'));var moment=require('moment');var BPromise=require(_0xe58b('0x2'));var rs=require(_0xe58b('0x3'));var fs=require('fs');var Redis=require(_0xe58b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe58b('0x5'));var logger=require('../../config/logger')(_0xe58b('0x6'));var config=require(_0xe58b('0x7'));var jayson=require(_0xe58b('0x8'));var client=jayson[_0xe58b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dace2,_0x1f25a7,_0x47507f){return new BPromise(function(_0x33cb91,_0x5cc122){return client[_0xe58b('0xa')](_0x5dace2,_0x47507f)[_0xe58b('0xb')](function(_0x2563e5){logger['info'](_0xe58b('0xc'),_0x1f25a7,_0xe58b('0xd'));logger[_0xe58b('0xe')](_0xe58b('0xf'),_0x1f25a7,_0xe58b('0xd'),JSON[_0xe58b('0x10')](_0x2563e5));if(_0x2563e5[_0xe58b('0x11')]){if(_0x2563e5[_0xe58b('0x11')]['code']===0x1f4){logger[_0xe58b('0x11')](_0xe58b('0xc'),_0x1f25a7,_0x2563e5[_0xe58b('0x11')][_0xe58b('0x12')]);return _0x5cc122(_0x2563e5['error'][_0xe58b('0x12')]);}logger['error'](_0xe58b('0xc'),_0x1f25a7,_0x2563e5[_0xe58b('0x11')][_0xe58b('0x12')]);return _0x33cb91(_0x2563e5['error'][_0xe58b('0x12')]);}else{logger[_0xe58b('0x13')](_0xe58b('0xc'),_0x1f25a7,_0xe58b('0xd'));_0x33cb91(_0x2563e5['result'][_0xe58b('0x12')]);}})['catch'](function(_0x3d30be){logger[_0xe58b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1f25a7,_0x3d30be);_0x5cc122(_0x3d30be);});});}