Built motion from commit c738b9ac.|2.6.25
[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 _0x9e05=['../../config/environment','client','http','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','ZohoField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x9e05,0x1c3));var _0x59e0=function(_0x343385,_0x4f83d5){_0x343385=_0x343385-0x0;var _0x472cf1=_0x9e05[_0x343385];return _0x472cf1;};'use strict';var _=require(_0x59e0('0x0'));var util=require(_0x59e0('0x1'));var moment=require(_0x59e0('0x2'));var BPromise=require(_0x59e0('0x3'));var rs=require(_0x59e0('0x4'));var fs=require('fs');var Redis=require(_0x59e0('0x5'));var db=require(_0x59e0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x59e0('0x7'))(_0x59e0('0x8'));var config=require(_0x59e0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x59e0('0xa')][_0x59e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4662d0,_0x319b65,_0x4fce95){return new BPromise(function(_0x639cee,_0x445f53){return client['request'](_0x4662d0,_0x4fce95)[_0x59e0('0xc')](function(_0x901ab3){logger[_0x59e0('0xd')]('ZohoField,\x20%s,\x20%s',_0x319b65,_0x59e0('0xe'));logger[_0x59e0('0xf')](_0x59e0('0x10'),_0x319b65,_0x59e0('0xe'),JSON['stringify'](_0x901ab3));if(_0x901ab3['error']){if(_0x901ab3[_0x59e0('0x11')][_0x59e0('0x12')]===0x1f4){logger[_0x59e0('0x11')]('ZohoField,\x20%s,\x20%s',_0x319b65,_0x901ab3[_0x59e0('0x11')][_0x59e0('0x13')]);return _0x445f53(_0x901ab3[_0x59e0('0x11')][_0x59e0('0x13')]);}logger[_0x59e0('0x11')](_0x59e0('0x14'),_0x319b65,_0x901ab3[_0x59e0('0x11')][_0x59e0('0x13')]);return _0x639cee(_0x901ab3[_0x59e0('0x11')][_0x59e0('0x13')]);}else{logger[_0x59e0('0xd')](_0x59e0('0x14'),_0x319b65,_0x59e0('0xe'));_0x639cee(_0x901ab3[_0x59e0('0x15')][_0x59e0('0x13')]);}})[_0x59e0('0x16')](function(_0x12a3e9){logger[_0x59e0('0x11')](_0x59e0('0x14'),_0x319b65,_0x12a3e9);_0x445f53(_0x12a3e9);});});}