91f9341b3d2343673e57869a2abe1476380c6f74
[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 _0x24f5=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x33dc05,_0xa01811){var _0x8c14e5=function(_0x76e450){while(--_0x76e450){_0x33dc05['push'](_0x33dc05['shift']());}};_0x8c14e5(++_0xa01811);}(_0x24f5,0x1ee));var _0x524f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24f5[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x524f('0x0'));var util=require(_0x524f('0x1'));var moment=require(_0x524f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x524f('0x3'));var db=require(_0x524f('0x4'))['db'];var utils=require(_0x524f('0x5'));var logger=require(_0x524f('0x6'))(_0x524f('0x7'));var config=require(_0x524f('0x8'));var jayson=require(_0x524f('0x9'));var client=jayson['client'][_0x524f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35acad,_0x511cbc,_0x51eaa7){return new BPromise(function(_0xf012a3,_0x2e3cd4){return client[_0x524f('0xb')](_0x35acad,_0x51eaa7)[_0x524f('0xc')](function(_0x50110a){logger[_0x524f('0xd')](_0x524f('0xe'),_0x511cbc,_0x524f('0xf'));logger['debug'](_0x524f('0x10'),_0x511cbc,_0x524f('0xf'),JSON[_0x524f('0x11')](_0x50110a));if(_0x50110a['error']){if(_0x50110a[_0x524f('0x12')]['code']===0x1f4){logger[_0x524f('0x12')](_0x524f('0xe'),_0x511cbc,_0x50110a[_0x524f('0x12')][_0x524f('0x13')]);return _0x2e3cd4(_0x50110a[_0x524f('0x12')][_0x524f('0x13')]);}logger['error'](_0x524f('0xe'),_0x511cbc,_0x50110a[_0x524f('0x12')][_0x524f('0x13')]);return _0xf012a3(_0x50110a[_0x524f('0x12')][_0x524f('0x13')]);}else{logger[_0x524f('0xd')](_0x524f('0xe'),_0x511cbc,_0x524f('0xf'));_0xf012a3(_0x50110a[_0x524f('0x14')][_0x524f('0x13')]);}})[_0x524f('0x15')](function(_0x1e824e){logger['error'](_0x524f('0xe'),_0x511cbc,_0x1e824e);_0x2e3cd4(_0x1e824e);});});}