85db58c5906d24e9f536a25862f81940a121eac0
[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 _0x5f35=['../../config/environment','client','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4be46d,_0x48e9f1){var _0x269e43=function(_0x426ed7){while(--_0x426ed7){_0x4be46d['push'](_0x4be46d['shift']());}};_0x269e43(++_0x48e9f1);}(_0x5f35,0x1b1));var _0x55f3=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x5f35[_0x4d180c];return _0x49b57e;};'use strict';var _=require(_0x55f3('0x0'));var util=require('util');var moment=require(_0x55f3('0x1'));var BPromise=require(_0x55f3('0x2'));var rs=require(_0x55f3('0x3'));var fs=require('fs');var Redis=require(_0x55f3('0x4'));var db=require(_0x55f3('0x5'))['db'];var utils=require(_0x55f3('0x6'));var logger=require(_0x55f3('0x7'))('rpc');var config=require(_0x55f3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x55f3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d51e9,_0x2c1995,_0x48569c){return new BPromise(function(_0x5c5cde,_0x250fde){return client['request'](_0x5d51e9,_0x48569c)[_0x55f3('0xa')](function(_0x283b3f){logger[_0x55f3('0xb')](_0x55f3('0xc'),_0x2c1995,_0x55f3('0xd'));logger[_0x55f3('0xe')](_0x55f3('0xf'),_0x2c1995,_0x55f3('0xd'),JSON['stringify'](_0x283b3f));if(_0x283b3f[_0x55f3('0x10')]){if(_0x283b3f[_0x55f3('0x10')][_0x55f3('0x11')]===0x1f4){logger[_0x55f3('0x10')](_0x55f3('0xc'),_0x2c1995,_0x283b3f[_0x55f3('0x10')]['message']);return _0x250fde(_0x283b3f[_0x55f3('0x10')][_0x55f3('0x12')]);}logger[_0x55f3('0x10')](_0x55f3('0xc'),_0x2c1995,_0x283b3f[_0x55f3('0x10')][_0x55f3('0x12')]);return _0x5c5cde(_0x283b3f[_0x55f3('0x10')][_0x55f3('0x12')]);}else{logger['info'](_0x55f3('0xc'),_0x2c1995,_0x55f3('0xd'));_0x5c5cde(_0x283b3f[_0x55f3('0x13')][_0x55f3('0x12')]);}})[_0x55f3('0x14')](function(_0xc1cf5f){logger[_0x55f3('0x10')](_0x55f3('0xc'),_0x2c1995,_0xc1cf5f);_0x250fde(_0xc1cf5f);});});}