Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / intZohoField / intZohoField.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 _0xcb2f=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0xcb2f,0x101));var _0xfcb2=function(_0x215b0b,_0x1abffe){_0x215b0b=_0x215b0b-0x0;var _0x435991=_0xcb2f[_0x215b0b];return _0x435991;};'use strict';var _=require(_0xfcb2('0x0'));var util=require(_0xfcb2('0x1'));var moment=require(_0xfcb2('0x2'));var BPromise=require('bluebird');var rs=require(_0xfcb2('0x3'));var fs=require('fs');var Redis=require(_0xfcb2('0x4'));var db=require(_0xfcb2('0x5'))['db'];var utils=require(_0xfcb2('0x6'));var logger=require(_0xfcb2('0x7'))(_0xfcb2('0x8'));var config=require(_0xfcb2('0x9'));var jayson=require(_0xfcb2('0xa'));var client=jayson['client'][_0xfcb2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x89fea1,_0x350ff7,_0x1b63e1){return new BPromise(function(_0x484344,_0x4867c9){return client['request'](_0x89fea1,_0x1b63e1)['then'](function(_0x3edcb3){logger[_0xfcb2('0xc')](_0xfcb2('0xd'),_0x350ff7,_0xfcb2('0xe'));logger[_0xfcb2('0xf')](_0xfcb2('0x10'),_0x350ff7,_0xfcb2('0xe'),JSON[_0xfcb2('0x11')](_0x3edcb3));if(_0x3edcb3[_0xfcb2('0x12')]){if(_0x3edcb3['error']['code']===0x1f4){logger[_0xfcb2('0x12')]('ZohoField,\x20%s,\x20%s',_0x350ff7,_0x3edcb3[_0xfcb2('0x12')][_0xfcb2('0x13')]);return _0x4867c9(_0x3edcb3[_0xfcb2('0x12')][_0xfcb2('0x13')]);}logger[_0xfcb2('0x12')](_0xfcb2('0xd'),_0x350ff7,_0x3edcb3['error'][_0xfcb2('0x13')]);return _0x484344(_0x3edcb3[_0xfcb2('0x12')]['message']);}else{logger[_0xfcb2('0xc')](_0xfcb2('0xd'),_0x350ff7,'request\x20sent');_0x484344(_0x3edcb3['result'][_0xfcb2('0x13')]);}})[_0xfcb2('0x14')](function(_0x6cd37e){logger['error'](_0xfcb2('0xd'),_0x350ff7,_0x6cd37e);_0x4867c9(_0x6cd37e);});});}