Built motion from commit (unavailable).|2.5.13
[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 _0x0c6a=['message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s'];(function(_0x287401,_0x4c29be){var _0x166ec0=function(_0x2dc253){while(--_0x2dc253){_0x287401['push'](_0x287401['shift']());}};_0x166ec0(++_0x4c29be);}(_0x0c6a,0x157));var _0xa0c6=function(_0x4a5760,_0x134c15){_0x4a5760=_0x4a5760-0x0;var _0x2994b=_0x0c6a[_0x4a5760];return _0x2994b;};'use strict';var _=require('lodash');var util=require(_0xa0c6('0x0'));var moment=require('moment');var BPromise=require(_0xa0c6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0c6('0x2'));var db=require(_0xa0c6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0c6('0x4'))(_0xa0c6('0x5'));var config=require(_0xa0c6('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa0c6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cd359,_0x4e26f5,_0x3f7f8d){return new BPromise(function(_0x2e8c38,_0x4ba898){return client[_0xa0c6('0x8')](_0x5cd359,_0x3f7f8d)['then'](function(_0x1046d4){logger[_0xa0c6('0x9')]('FreshsalesField,\x20%s,\x20%s',_0x4e26f5,_0xa0c6('0xa'));logger[_0xa0c6('0xb')](_0xa0c6('0xc'),_0x4e26f5,_0xa0c6('0xa'),JSON[_0xa0c6('0xd')](_0x1046d4));if(_0x1046d4[_0xa0c6('0xe')]){if(_0x1046d4[_0xa0c6('0xe')][_0xa0c6('0xf')]===0x1f4){logger[_0xa0c6('0xe')](_0xa0c6('0x10'),_0x4e26f5,_0x1046d4[_0xa0c6('0xe')][_0xa0c6('0x11')]);return _0x4ba898(_0x1046d4[_0xa0c6('0xe')][_0xa0c6('0x11')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e26f5,_0x1046d4[_0xa0c6('0xe')][_0xa0c6('0x11')]);return _0x2e8c38(_0x1046d4[_0xa0c6('0xe')][_0xa0c6('0x11')]);}else{logger['info'](_0xa0c6('0x10'),_0x4e26f5,_0xa0c6('0xa'));_0x2e8c38(_0x1046d4[_0xa0c6('0x12')][_0xa0c6('0x11')]);}})[_0xa0c6('0x13')](function(_0xfac9dc){logger[_0xa0c6('0xe')](_0xa0c6('0x10'),_0x4e26f5,_0xfac9dc);_0x4ba898(_0xfac9dc);});});}