Built motion from commit (unavailable).|2.4.18
[motion2.git] / server / api / intFreshsalesField / intFreshsalesField.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 _0x7a12=['FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x7a12,0xe8));var _0x27a1=function(_0xccaeba,_0x29fb00){_0xccaeba=_0xccaeba-0x0;var _0x307313=_0x7a12[_0xccaeba];return _0x307313;};'use strict';var _=require(_0x27a1('0x0'));var util=require(_0x27a1('0x1'));var moment=require(_0x27a1('0x2'));var BPromise=require(_0x27a1('0x3'));var rs=require(_0x27a1('0x4'));var fs=require('fs');var Redis=require(_0x27a1('0x5'));var db=require(_0x27a1('0x6'))['db'];var utils=require(_0x27a1('0x7'));var logger=require('../../config/logger')(_0x27a1('0x8'));var config=require(_0x27a1('0x9'));var jayson=require(_0x27a1('0xa'));var client=jayson[_0x27a1('0xb')][_0x27a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xed784f,_0x4a4e2c,_0x3f0bbd){return new BPromise(function(_0x34efbb,_0x5431f4){return client[_0x27a1('0xd')](_0xed784f,_0x3f0bbd)[_0x27a1('0xe')](function(_0x586984){logger[_0x27a1('0xf')](_0x27a1('0x10'),_0x4a4e2c,_0x27a1('0x11'));logger['debug'](_0x27a1('0x12'),_0x4a4e2c,_0x27a1('0x11'),JSON[_0x27a1('0x13')](_0x586984));if(_0x586984[_0x27a1('0x14')]){if(_0x586984[_0x27a1('0x14')][_0x27a1('0x15')]===0x1f4){logger[_0x27a1('0x14')]('FreshsalesField,\x20%s,\x20%s',_0x4a4e2c,_0x586984[_0x27a1('0x14')][_0x27a1('0x16')]);return _0x5431f4(_0x586984[_0x27a1('0x14')][_0x27a1('0x16')]);}logger['error'](_0x27a1('0x10'),_0x4a4e2c,_0x586984[_0x27a1('0x14')]['message']);return _0x34efbb(_0x586984['error'][_0x27a1('0x16')]);}else{logger[_0x27a1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x4a4e2c,_0x27a1('0x11'));_0x34efbb(_0x586984[_0x27a1('0x17')]['message']);}})[_0x27a1('0x18')](function(_0x3efeff){logger[_0x27a1('0x14')](_0x27a1('0x10'),_0x4a4e2c,_0x3efeff);_0x5431f4(_0x3efeff);});});}