Built motion from commit (unavailable).|2.5.20
[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 _0xcc7d=['request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x246890,_0x46b964){var _0x2b2a5a=function(_0x4f1232){while(--_0x4f1232){_0x246890['push'](_0x246890['shift']());}};_0x2b2a5a(++_0x46b964);}(_0xcc7d,0x1ae));var _0xdcc7=function(_0x5227bb,_0x2de3e7){_0x5227bb=_0x5227bb-0x0;var _0x334af5=_0xcc7d[_0x5227bb];return _0x334af5;};'use strict';var _=require(_0xdcc7('0x0'));var util=require(_0xdcc7('0x1'));var moment=require('moment');var BPromise=require(_0xdcc7('0x2'));var rs=require(_0xdcc7('0x3'));var fs=require('fs');var Redis=require(_0xdcc7('0x4'));var db=require(_0xdcc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdcc7('0x6'))('rpc');var config=require(_0xdcc7('0x7'));var jayson=require(_0xdcc7('0x8'));var client=jayson[_0xdcc7('0x9')][_0xdcc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f9f4a,_0x160fa4,_0x4f7762){return new BPromise(function(_0x3f06b0,_0x3be02a){return client[_0xdcc7('0xb')](_0x4f9f4a,_0x4f7762)[_0xdcc7('0xc')](function(_0x1c0928){logger[_0xdcc7('0xd')](_0xdcc7('0xe'),_0x160fa4,_0xdcc7('0xf'));logger['debug'](_0xdcc7('0x10'),_0x160fa4,_0xdcc7('0xf'),JSON[_0xdcc7('0x11')](_0x1c0928));if(_0x1c0928[_0xdcc7('0x12')]){if(_0x1c0928['error']['code']===0x1f4){logger[_0xdcc7('0x12')](_0xdcc7('0xe'),_0x160fa4,_0x1c0928['error'][_0xdcc7('0x13')]);return _0x3be02a(_0x1c0928[_0xdcc7('0x12')][_0xdcc7('0x13')]);}logger[_0xdcc7('0x12')](_0xdcc7('0xe'),_0x160fa4,_0x1c0928['error'][_0xdcc7('0x13')]);return _0x3f06b0(_0x1c0928[_0xdcc7('0x12')][_0xdcc7('0x13')]);}else{logger[_0xdcc7('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x160fa4,_0xdcc7('0xf'));_0x3f06b0(_0x1c0928[_0xdcc7('0x14')][_0xdcc7('0x13')]);}})['catch'](function(_0x2e4aea){logger['error'](_0xdcc7('0xe'),_0x160fa4,_0x2e4aea);_0x3be02a(_0x2e4aea);});});}