Built motion from commit 5293bb2a.|2.6.30
[motion2.git] / server / api / intSugarcrmField / intSugarcrmField.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 _0x5a7e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','lodash','util'];(function(_0x1ffb10,_0x28ce2c){var _0x390ad0=function(_0x1d1c1c){while(--_0x1d1c1c){_0x1ffb10['push'](_0x1ffb10['shift']());}};_0x390ad0(++_0x28ce2c);}(_0x5a7e,0xcd));var _0xe5a7=function(_0x4df224,_0x31c3d6){_0x4df224=_0x4df224-0x0;var _0x3e3bcd=_0x5a7e[_0x4df224];return _0x3e3bcd;};'use strict';var _=require(_0xe5a7('0x0'));var util=require(_0xe5a7('0x1'));var moment=require(_0xe5a7('0x2'));var BPromise=require(_0xe5a7('0x3'));var rs=require(_0xe5a7('0x4'));var fs=require('fs');var Redis=require(_0xe5a7('0x5'));var db=require(_0xe5a7('0x6'))['db'];var utils=require(_0xe5a7('0x7'));var logger=require('../../config/logger')(_0xe5a7('0x8'));var config=require(_0xe5a7('0x9'));var jayson=require(_0xe5a7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10e47e,_0x3ac481,_0x25050a){return new BPromise(function(_0x4e799f,_0x1f2e94){return client[_0xe5a7('0xb')](_0x10e47e,_0x25050a)[_0xe5a7('0xc')](function(_0x4e1c46){logger[_0xe5a7('0xd')](_0xe5a7('0xe'),_0x3ac481,'request\x20sent');logger[_0xe5a7('0xf')](_0xe5a7('0x10'),_0x3ac481,'request\x20sent',JSON[_0xe5a7('0x11')](_0x4e1c46));if(_0x4e1c46['error']){if(_0x4e1c46['error'][_0xe5a7('0x12')]===0x1f4){logger[_0xe5a7('0x13')](_0xe5a7('0xe'),_0x3ac481,_0x4e1c46[_0xe5a7('0x13')][_0xe5a7('0x14')]);return _0x1f2e94(_0x4e1c46[_0xe5a7('0x13')]['message']);}logger[_0xe5a7('0x13')](_0xe5a7('0xe'),_0x3ac481,_0x4e1c46[_0xe5a7('0x13')][_0xe5a7('0x14')]);return _0x4e799f(_0x4e1c46['error'][_0xe5a7('0x14')]);}else{logger[_0xe5a7('0xd')](_0xe5a7('0xe'),_0x3ac481,_0xe5a7('0x15'));_0x4e799f(_0x4e1c46[_0xe5a7('0x16')][_0xe5a7('0x14')]);}})['catch'](function(_0xc05619){logger[_0xe5a7('0x13')](_0xe5a7('0xe'),_0x3ac481,_0xc05619);_0x1f2e94(_0xc05619);});});}