Built motion from commit (unavailable).|2.5.14
[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 _0x4d15=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash'];(function(_0x770f7,_0x3af003){var _0xe797c6=function(_0x47d92a){while(--_0x47d92a){_0x770f7['push'](_0x770f7['shift']());}};_0xe797c6(++_0x3af003);}(_0x4d15,0x137));var _0x54d1=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4d15[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x54d1('0x0'));var util=require(_0x54d1('0x1'));var moment=require(_0x54d1('0x2'));var BPromise=require(_0x54d1('0x3'));var rs=require(_0x54d1('0x4'));var fs=require('fs');var Redis=require(_0x54d1('0x5'));var db=require(_0x54d1('0x6'))['db'];var utils=require(_0x54d1('0x7'));var logger=require('../../config/logger')(_0x54d1('0x8'));var config=require(_0x54d1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x54d1('0xa')][_0x54d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f9bfb,_0x3d39cc,_0x52868f){return new BPromise(function(_0x11c117,_0x5cabdc){return client[_0x54d1('0xc')](_0x1f9bfb,_0x52868f)[_0x54d1('0xd')](function(_0x168877){logger[_0x54d1('0xe')](_0x54d1('0xf'),_0x3d39cc,_0x54d1('0x10'));logger['debug'](_0x54d1('0x11'),_0x3d39cc,'request\x20sent',JSON[_0x54d1('0x12')](_0x168877));if(_0x168877['error']){if(_0x168877['error'][_0x54d1('0x13')]===0x1f4){logger[_0x54d1('0x14')](_0x54d1('0xf'),_0x3d39cc,_0x168877[_0x54d1('0x14')][_0x54d1('0x15')]);return _0x5cabdc(_0x168877[_0x54d1('0x14')]['message']);}logger[_0x54d1('0x14')]('FreshsalesField,\x20%s,\x20%s',_0x3d39cc,_0x168877[_0x54d1('0x14')][_0x54d1('0x15')]);return _0x11c117(_0x168877[_0x54d1('0x14')]['message']);}else{logger[_0x54d1('0xe')](_0x54d1('0xf'),_0x3d39cc,_0x54d1('0x10'));_0x11c117(_0x168877[_0x54d1('0x16')][_0x54d1('0x15')]);}})[_0x54d1('0x17')](function(_0x1dcbfa){logger[_0x54d1('0x14')](_0x54d1('0xf'),_0x3d39cc,_0x1dcbfa);_0x5cabdc(_0x1dcbfa);});});}