Built motion from commit 47436d59.|2.6.7
[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 _0x5ee2=['code','SugarcrmField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15890c,_0x1318a2){var _0xaf8c2=function(_0x4861a1){while(--_0x4861a1){_0x15890c['push'](_0x15890c['shift']());}};_0xaf8c2(++_0x1318a2);}(_0x5ee2,0x184));var _0x25ee=function(_0x31de59,_0x5c622e){_0x31de59=_0x31de59-0x0;var _0x35c925=_0x5ee2[_0x31de59];return _0x35c925;};'use strict';var _=require(_0x25ee('0x0'));var util=require(_0x25ee('0x1'));var moment=require(_0x25ee('0x2'));var BPromise=require(_0x25ee('0x3'));var rs=require(_0x25ee('0x4'));var fs=require('fs');var Redis=require(_0x25ee('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x25ee('0x6'))(_0x25ee('0x7'));var config=require(_0x25ee('0x8'));var jayson=require(_0x25ee('0x9'));var client=jayson[_0x25ee('0xa')][_0x25ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x205be5,_0x1cc4ef,_0x2a3959){return new BPromise(function(_0x42547a,_0x2563a3){return client[_0x25ee('0xc')](_0x205be5,_0x2a3959)[_0x25ee('0xd')](function(_0x4611cf){logger[_0x25ee('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x1cc4ef,_0x25ee('0xf'));logger[_0x25ee('0x10')](_0x25ee('0x11'),_0x1cc4ef,_0x25ee('0xf'),JSON[_0x25ee('0x12')](_0x4611cf));if(_0x4611cf[_0x25ee('0x13')]){if(_0x4611cf[_0x25ee('0x13')][_0x25ee('0x14')]===0x1f4){logger[_0x25ee('0x13')](_0x25ee('0x15'),_0x1cc4ef,_0x4611cf[_0x25ee('0x13')]['message']);return _0x2563a3(_0x4611cf[_0x25ee('0x13')][_0x25ee('0x16')]);}logger[_0x25ee('0x13')](_0x25ee('0x15'),_0x1cc4ef,_0x4611cf['error'][_0x25ee('0x16')]);return _0x42547a(_0x4611cf[_0x25ee('0x13')][_0x25ee('0x16')]);}else{logger[_0x25ee('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x1cc4ef,_0x25ee('0xf'));_0x42547a(_0x4611cf[_0x25ee('0x17')][_0x25ee('0x16')]);}})['catch'](function(_0x5bba38){logger[_0x25ee('0x13')](_0x25ee('0x15'),_0x1cc4ef,_0x5bba38);_0x2563a3(_0x5bba38);});});}