Built motion from commit (unavailable).|2.5.30
[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 _0x2bae=['stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x2ef61f,_0x41ac76){var _0x58fff2=function(_0x150cb6){while(--_0x150cb6){_0x2ef61f['push'](_0x2ef61f['shift']());}};_0x58fff2(++_0x41ac76);}(_0x2bae,0xe2));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2ba('0x0'));var util=require(_0xe2ba('0x1'));var moment=require(_0xe2ba('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2ba('0x3'));var fs=require('fs');var Redis=require(_0xe2ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2ba('0x5'));var logger=require(_0xe2ba('0x6'))(_0xe2ba('0x7'));var config=require(_0xe2ba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe2ba('0x9')][_0xe2ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35ec31,_0x5a8154,_0x3a6bfd){return new BPromise(function(_0x2409b,_0x608b0f){return client[_0xe2ba('0xb')](_0x35ec31,_0x3a6bfd)[_0xe2ba('0xc')](function(_0x3ab464){logger[_0xe2ba('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x5a8154,_0xe2ba('0xe'));logger['debug'](_0xe2ba('0xf'),_0x5a8154,_0xe2ba('0xe'),JSON[_0xe2ba('0x10')](_0x3ab464));if(_0x3ab464[_0xe2ba('0x11')]){if(_0x3ab464[_0xe2ba('0x11')][_0xe2ba('0x12')]===0x1f4){logger[_0xe2ba('0x11')](_0xe2ba('0x13'),_0x5a8154,_0x3ab464['error'][_0xe2ba('0x14')]);return _0x608b0f(_0x3ab464[_0xe2ba('0x11')]['message']);}logger['error'](_0xe2ba('0x13'),_0x5a8154,_0x3ab464['error']['message']);return _0x2409b(_0x3ab464['error'][_0xe2ba('0x14')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x5a8154,_0xe2ba('0xe'));_0x2409b(_0x3ab464[_0xe2ba('0x15')][_0xe2ba('0x14')]);}})['catch'](function(_0x29c4f6){logger['error'](_0xe2ba('0x13'),_0x5a8154,_0x29c4f6);_0x608b0f(_0x29c4f6);});});}