d362704d399a8bf002c8f72b98a1a935a040643b
[motion2.git] / server / api / intSugarcrmConfiguration / intSugarcrmConfiguration.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 _0xb8e5=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x19bf7d,_0x4b4b58){var _0x548354=function(_0x5ce5cb){while(--_0x5ce5cb){_0x19bf7d['push'](_0x19bf7d['shift']());}};_0x548354(++_0x4b4b58);}(_0xb8e5,0x1ad));var _0x5b8e=function(_0x2851d7,_0x4d945a){_0x2851d7=_0x2851d7-0x0;var _0x45b548=_0xb8e5[_0x2851d7];return _0x45b548;};'use strict';var _=require(_0x5b8e('0x0'));var util=require(_0x5b8e('0x1'));var moment=require(_0x5b8e('0x2'));var BPromise=require(_0x5b8e('0x3'));var rs=require(_0x5b8e('0x4'));var fs=require('fs');var Redis=require(_0x5b8e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b8e('0x6'))('rpc');var config=require(_0x5b8e('0x7'));var jayson=require(_0x5b8e('0x8'));var client=jayson[_0x5b8e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57af9e,_0x4f4bfb,_0x3298dc){return new BPromise(function(_0x12066c,_0x43a33d){return client[_0x5b8e('0xa')](_0x57af9e,_0x3298dc)[_0x5b8e('0xb')](function(_0x498d54){logger[_0x5b8e('0xc')](_0x5b8e('0xd'),_0x4f4bfb,_0x5b8e('0xe'));logger[_0x5b8e('0xf')](_0x5b8e('0x10'),_0x4f4bfb,_0x5b8e('0xe'),JSON['stringify'](_0x498d54));if(_0x498d54[_0x5b8e('0x11')]){if(_0x498d54[_0x5b8e('0x11')][_0x5b8e('0x12')]===0x1f4){logger[_0x5b8e('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f4bfb,_0x498d54[_0x5b8e('0x11')]['message']);return _0x43a33d(_0x498d54[_0x5b8e('0x11')][_0x5b8e('0x13')]);}logger[_0x5b8e('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f4bfb,_0x498d54['error'][_0x5b8e('0x13')]);return _0x12066c(_0x498d54[_0x5b8e('0x11')]['message']);}else{logger[_0x5b8e('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f4bfb,_0x5b8e('0xe'));_0x12066c(_0x498d54[_0x5b8e('0x14')][_0x5b8e('0x13')]);}})[_0x5b8e('0x15')](function(_0x561598){logger[_0x5b8e('0x11')](_0x5b8e('0xd'),_0x4f4bfb,_0x561598);_0x43a33d(_0x561598);});});}