b9e5b0095e0f2264673311c1e5c4a5debadf3885
[motion2.git] / server / api / jscriptyProject / jscriptyProject.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 _0x6d6f=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x27b409,_0x2186a3){var _0x4a1d34=function(_0x16eecf){while(--_0x16eecf){_0x27b409['push'](_0x27b409['shift']());}};_0x4a1d34(++_0x2186a3);}(_0x6d6f,0x1b7));var _0xf6d6=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x6d6f[_0x2ec2bf];return _0x2c279c;};'use strict';var _=require(_0xf6d6('0x0'));var util=require(_0xf6d6('0x1'));var moment=require(_0xf6d6('0x2'));var BPromise=require(_0xf6d6('0x3'));var rs=require(_0xf6d6('0x4'));var fs=require('fs');var Redis=require(_0xf6d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6d6('0x6'))(_0xf6d6('0x7'));var config=require(_0xf6d6('0x8'));var jayson=require(_0xf6d6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40d6f1,_0x4252c9,_0x3c0657){return new BPromise(function(_0x971b09,_0xf7407f){return client[_0xf6d6('0xa')](_0x40d6f1,_0x3c0657)['then'](function(_0x4250dc){logger[_0xf6d6('0xb')](_0xf6d6('0xc'),_0x4252c9,_0xf6d6('0xd'));logger[_0xf6d6('0xe')](_0xf6d6('0xf'),_0x4252c9,_0xf6d6('0xd'),JSON[_0xf6d6('0x10')](_0x4250dc));if(_0x4250dc[_0xf6d6('0x11')]){if(_0x4250dc[_0xf6d6('0x11')][_0xf6d6('0x12')]===0x1f4){logger['error'](_0xf6d6('0xc'),_0x4252c9,_0x4250dc[_0xf6d6('0x11')][_0xf6d6('0x13')]);return _0xf7407f(_0x4250dc[_0xf6d6('0x11')][_0xf6d6('0x13')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4252c9,_0x4250dc[_0xf6d6('0x11')][_0xf6d6('0x13')]);return _0x971b09(_0x4250dc['error'][_0xf6d6('0x13')]);}else{logger['info'](_0xf6d6('0xc'),_0x4252c9,_0xf6d6('0xd'));_0x971b09(_0x4250dc[_0xf6d6('0x14')][_0xf6d6('0x13')]);}})['catch'](function(_0xbb3c4e){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4252c9,_0xbb3c4e);_0xf7407f(_0xbb3c4e);});});}