Built motion from commit 953226e6.|2.6.32
[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 _0xa7f1=['jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x4bbcc1,_0x594e19){var _0x34435b=function(_0x124582){while(--_0x124582){_0x4bbcc1['push'](_0x4bbcc1['shift']());}};_0x34435b(++_0x594e19);}(_0xa7f1,0x92));var _0x1a7f=function(_0x2929ba,_0x506aa6){_0x2929ba=_0x2929ba-0x0;var _0x365e6e=_0xa7f1[_0x2929ba];return _0x365e6e;};'use strict';var _=require(_0x1a7f('0x0'));var util=require(_0x1a7f('0x1'));var moment=require(_0x1a7f('0x2'));var BPromise=require(_0x1a7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a7f('0x4'));var db=require(_0x1a7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a7f('0x6'));var config=require(_0x1a7f('0x7'));var jayson=require(_0x1a7f('0x8'));var client=jayson[_0x1a7f('0x9')][_0x1a7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50c1b6,_0x4f9064,_0x5cc8c5){return new BPromise(function(_0x137342,_0x46cc9a){return client[_0x1a7f('0xb')](_0x50c1b6,_0x5cc8c5)['then'](function(_0x128db6){logger[_0x1a7f('0xc')](_0x1a7f('0xd'),_0x4f9064,_0x1a7f('0xe'));logger[_0x1a7f('0xf')](_0x1a7f('0x10'),_0x4f9064,_0x1a7f('0xe'),JSON[_0x1a7f('0x11')](_0x128db6));if(_0x128db6[_0x1a7f('0x12')]){if(_0x128db6[_0x1a7f('0x12')]['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x4f9064,_0x128db6[_0x1a7f('0x12')][_0x1a7f('0x13')]);return _0x46cc9a(_0x128db6[_0x1a7f('0x12')]['message']);}logger[_0x1a7f('0x12')](_0x1a7f('0xd'),_0x4f9064,_0x128db6[_0x1a7f('0x12')][_0x1a7f('0x13')]);return _0x137342(_0x128db6[_0x1a7f('0x12')]['message']);}else{logger[_0x1a7f('0xc')](_0x1a7f('0xd'),_0x4f9064,_0x1a7f('0xe'));_0x137342(_0x128db6[_0x1a7f('0x14')][_0x1a7f('0x13')]);}})[_0x1a7f('0x15')](function(_0x35261b){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x4f9064,_0x35261b);_0x46cc9a(_0x35261b);});});}