Built motion from commit 497d3d92.|2.5.43
[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 _0x6c1c=['request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2ca7b9,_0x4acfeb){var _0x4949e7=function(_0x55c0ef){while(--_0x55c0ef){_0x2ca7b9['push'](_0x2ca7b9['shift']());}};_0x4949e7(++_0x4acfeb);}(_0x6c1c,0x19c));var _0xc6c1=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x6c1c[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xc6c1('0x0'));var util=require(_0xc6c1('0x1'));var moment=require(_0xc6c1('0x2'));var BPromise=require('bluebird');var rs=require(_0xc6c1('0x3'));var fs=require('fs');var Redis=require(_0xc6c1('0x4'));var db=require(_0xc6c1('0x5'))['db'];var utils=require(_0xc6c1('0x6'));var logger=require(_0xc6c1('0x7'))(_0xc6c1('0x8'));var config=require(_0xc6c1('0x9'));var jayson=require(_0xc6c1('0xa'));var client=jayson[_0xc6c1('0xb')][_0xc6c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45beef,_0x2e3438,_0x4909cc){return new BPromise(function(_0x134f77,_0x5282a1){return client[_0xc6c1('0xd')](_0x45beef,_0x4909cc)[_0xc6c1('0xe')](function(_0x65f59b){logger['info'](_0xc6c1('0xf'),_0x2e3438,_0xc6c1('0x10'));logger[_0xc6c1('0x11')](_0xc6c1('0x12'),_0x2e3438,_0xc6c1('0x10'),JSON['stringify'](_0x65f59b));if(_0x65f59b[_0xc6c1('0x13')]){if(_0x65f59b[_0xc6c1('0x13')][_0xc6c1('0x14')]===0x1f4){logger[_0xc6c1('0x13')](_0xc6c1('0xf'),_0x2e3438,_0x65f59b[_0xc6c1('0x13')][_0xc6c1('0x15')]);return _0x5282a1(_0x65f59b[_0xc6c1('0x13')][_0xc6c1('0x15')]);}logger[_0xc6c1('0x13')](_0xc6c1('0xf'),_0x2e3438,_0x65f59b['error'][_0xc6c1('0x15')]);return _0x134f77(_0x65f59b[_0xc6c1('0x13')][_0xc6c1('0x15')]);}else{logger[_0xc6c1('0x16')](_0xc6c1('0xf'),_0x2e3438,'request\x20sent');_0x134f77(_0x65f59b[_0xc6c1('0x17')][_0xc6c1('0x15')]);}})[_0xc6c1('0x18')](function(_0x52e5e2){logger[_0xc6c1('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2e3438,_0x52e5e2);_0x5282a1(_0x52e5e2);});});}