Built motion from commit (unavailable).|2.5.23
[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 _0xf960=['http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3ee21e,_0x5cf64c){var _0x10755a=function(_0x31d3a9){while(--_0x31d3a9){_0x3ee21e['push'](_0x3ee21e['shift']());}};_0x10755a(++_0x5cf64c);}(_0xf960,0xde));var _0x0f96=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0xf960[_0x4536a4];return _0x4fd1c1;};'use strict';var _=require('lodash');var util=require(_0x0f96('0x0'));var moment=require(_0x0f96('0x1'));var BPromise=require(_0x0f96('0x2'));var rs=require(_0x0f96('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f96('0x4'))['db'];var utils=require(_0x0f96('0x5'));var logger=require('../../config/logger')(_0x0f96('0x6'));var config=require(_0x0f96('0x7'));var jayson=require(_0x0f96('0x8'));var client=jayson['client'][_0x0f96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3831af,_0x547611,_0x10b0b6){return new BPromise(function(_0x16327c,_0x536a05){return client[_0x0f96('0xa')](_0x3831af,_0x10b0b6)[_0x0f96('0xb')](function(_0x452abf){logger[_0x0f96('0xc')](_0x0f96('0xd'),_0x547611,_0x0f96('0xe'));logger[_0x0f96('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x547611,_0x0f96('0xe'),JSON[_0x0f96('0x10')](_0x452abf));if(_0x452abf[_0x0f96('0x11')]){if(_0x452abf[_0x0f96('0x11')][_0x0f96('0x12')]===0x1f4){logger[_0x0f96('0x11')](_0x0f96('0xd'),_0x547611,_0x452abf[_0x0f96('0x11')][_0x0f96('0x13')]);return _0x536a05(_0x452abf['error']['message']);}logger[_0x0f96('0x11')](_0x0f96('0xd'),_0x547611,_0x452abf[_0x0f96('0x11')]['message']);return _0x16327c(_0x452abf[_0x0f96('0x11')][_0x0f96('0x13')]);}else{logger[_0x0f96('0xc')](_0x0f96('0xd'),_0x547611,_0x0f96('0xe'));_0x16327c(_0x452abf[_0x0f96('0x14')][_0x0f96('0x13')]);}})['catch'](function(_0x41e0e3){logger[_0x0f96('0x11')](_0x0f96('0xd'),_0x547611,_0x41e0e3);_0x536a05(_0x41e0e3);});});}