3b3291a46b7e1e5ded90005b38225ee1d0a7b9a8
[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 _0xd991=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x53b243,_0x5d0b8c){var _0x4e2b9d=function(_0x1ad0b1){while(--_0x1ad0b1){_0x53b243['push'](_0x53b243['shift']());}};_0x4e2b9d(++_0x5d0b8c);}(_0xd991,0x188));var _0x1d99=function(_0x38cb4e,_0x1e562c){_0x38cb4e=_0x38cb4e-0x0;var _0x33e0aa=_0xd991[_0x38cb4e];return _0x33e0aa;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var moment=require(_0x1d99('0x2'));var BPromise=require(_0x1d99('0x3'));var rs=require(_0x1d99('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d99('0x5'))['db'];var utils=require(_0x1d99('0x6'));var logger=require(_0x1d99('0x7'))(_0x1d99('0x8'));var config=require(_0x1d99('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1d99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31a1c9,_0x548dfb,_0x3493b5){return new BPromise(function(_0x262903,_0x55339e){return client['request'](_0x31a1c9,_0x3493b5)[_0x1d99('0xb')](function(_0x394fa2){logger[_0x1d99('0xc')](_0x1d99('0xd'),_0x548dfb,'request\x20sent');logger[_0x1d99('0xe')](_0x1d99('0xf'),_0x548dfb,_0x1d99('0x10'),JSON['stringify'](_0x394fa2));if(_0x394fa2['error']){if(_0x394fa2[_0x1d99('0x11')][_0x1d99('0x12')]===0x1f4){logger['error'](_0x1d99('0xd'),_0x548dfb,_0x394fa2[_0x1d99('0x11')][_0x1d99('0x13')]);return _0x55339e(_0x394fa2[_0x1d99('0x11')][_0x1d99('0x13')]);}logger[_0x1d99('0x11')](_0x1d99('0xd'),_0x548dfb,_0x394fa2[_0x1d99('0x11')][_0x1d99('0x13')]);return _0x262903(_0x394fa2[_0x1d99('0x11')][_0x1d99('0x13')]);}else{logger[_0x1d99('0xc')](_0x1d99('0xd'),_0x548dfb,_0x1d99('0x10'));_0x262903(_0x394fa2[_0x1d99('0x14')][_0x1d99('0x13')]);}})[_0x1d99('0x15')](function(_0x2b6973){logger['error'](_0x1d99('0xd'),_0x548dfb,_0x2b6973);_0x55339e(_0x2b6973);});});}