Built motion from commit e02f907f.|2.6.14
[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 _0x6abe=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch'];(function(_0x31efe7,_0x52fe9e){var _0x24b6ee=function(_0x65ae94){while(--_0x65ae94){_0x31efe7['push'](_0x31efe7['shift']());}};_0x24b6ee(++_0x52fe9e);}(_0x6abe,0x176));var _0xe6ab=function(_0x59f8c7,_0x55714b){_0x59f8c7=_0x59f8c7-0x0;var _0x1eb6f3=_0x6abe[_0x59f8c7];return _0x1eb6f3;};'use strict';var _=require(_0xe6ab('0x0'));var util=require('util');var moment=require(_0xe6ab('0x1'));var BPromise=require(_0xe6ab('0x2'));var rs=require(_0xe6ab('0x3'));var fs=require('fs');var Redis=require(_0xe6ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6ab('0x5'));var logger=require(_0xe6ab('0x6'))(_0xe6ab('0x7'));var config=require(_0xe6ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe6ab('0x9')][_0xe6ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51058a,_0x547923,_0x289ad8){return new BPromise(function(_0x17f593,_0x1ff222){return client[_0xe6ab('0xb')](_0x51058a,_0x289ad8)['then'](function(_0x103ae4){logger[_0xe6ab('0xc')]('ZohoField,\x20%s,\x20%s',_0x547923,_0xe6ab('0xd'));logger['debug'](_0xe6ab('0xe'),_0x547923,'request\x20sent',JSON[_0xe6ab('0xf')](_0x103ae4));if(_0x103ae4[_0xe6ab('0x10')]){if(_0x103ae4['error'][_0xe6ab('0x11')]===0x1f4){logger[_0xe6ab('0x10')](_0xe6ab('0x12'),_0x547923,_0x103ae4[_0xe6ab('0x10')][_0xe6ab('0x13')]);return _0x1ff222(_0x103ae4[_0xe6ab('0x10')]['message']);}logger[_0xe6ab('0x10')]('ZohoField,\x20%s,\x20%s',_0x547923,_0x103ae4[_0xe6ab('0x10')][_0xe6ab('0x13')]);return _0x17f593(_0x103ae4[_0xe6ab('0x10')][_0xe6ab('0x13')]);}else{logger[_0xe6ab('0xc')](_0xe6ab('0x12'),_0x547923,_0xe6ab('0xd'));_0x17f593(_0x103ae4[_0xe6ab('0x14')][_0xe6ab('0x13')]);}})[_0xe6ab('0x15')](function(_0x2d7323){logger[_0xe6ab('0x10')]('ZohoField,\x20%s,\x20%s',_0x547923,_0x2d7323);_0x1ff222(_0x2d7323);});});}