Built motion from commit 8356fca3.|2.6.19
[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 _0x228a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x721a1f,_0x33d49e){var _0x42eaec=function(_0x4ae9f1){while(--_0x4ae9f1){_0x721a1f['push'](_0x721a1f['shift']());}};_0x42eaec(++_0x33d49e);}(_0x228a,0xe9));var _0xa228=function(_0x3c39f3,_0x41956){_0x3c39f3=_0x3c39f3-0x0;var _0x1924cc=_0x228a[_0x3c39f3];return _0x1924cc;};'use strict';var _=require(_0xa228('0x0'));var util=require(_0xa228('0x1'));var moment=require(_0xa228('0x2'));var BPromise=require(_0xa228('0x3'));var rs=require(_0xa228('0x4'));var fs=require('fs');var Redis=require(_0xa228('0x5'));var db=require(_0xa228('0x6'))['db'];var utils=require(_0xa228('0x7'));var logger=require(_0xa228('0x8'))(_0xa228('0x9'));var config=require(_0xa228('0xa'));var jayson=require(_0xa228('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x489c0f,_0x24718a,_0xc37fa8){return new BPromise(function(_0x2f55cb,_0x4ae754){return client[_0xa228('0xc')](_0x489c0f,_0xc37fa8)[_0xa228('0xd')](function(_0x21fd77){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x24718a,_0xa228('0xe'));logger['debug'](_0xa228('0xf'),_0x24718a,_0xa228('0xe'),JSON[_0xa228('0x10')](_0x21fd77));if(_0x21fd77[_0xa228('0x11')]){if(_0x21fd77['error'][_0xa228('0x12')]===0x1f4){logger[_0xa228('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x24718a,_0x21fd77[_0xa228('0x11')][_0xa228('0x13')]);return _0x4ae754(_0x21fd77[_0xa228('0x11')][_0xa228('0x13')]);}logger[_0xa228('0x11')](_0xa228('0x14'),_0x24718a,_0x21fd77[_0xa228('0x11')][_0xa228('0x13')]);return _0x2f55cb(_0x21fd77[_0xa228('0x11')][_0xa228('0x13')]);}else{logger[_0xa228('0x15')](_0xa228('0x14'),_0x24718a,_0xa228('0xe'));_0x2f55cb(_0x21fd77[_0xa228('0x16')][_0xa228('0x13')]);}})[_0xa228('0x17')](function(_0x2ee921){logger[_0xa228('0x11')](_0xa228('0x14'),_0x24718a,_0x2ee921);_0x4ae754(_0x2ee921);});});}