Built motion from commit 9d0783e6.|2.6.13
[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 _0xae27=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x179c89,_0x3a69b2){var _0x4b87e5=function(_0xbdf6f2){while(--_0xbdf6f2){_0x179c89['push'](_0x179c89['shift']());}};_0x4b87e5(++_0x3a69b2);}(_0xae27,0xa5));var _0x7ae2=function(_0x4d79bc,_0x32c905){_0x4d79bc=_0x4d79bc-0x0;var _0x4b4760=_0xae27[_0x4d79bc];return _0x4b4760;};'use strict';var _=require(_0x7ae2('0x0'));var util=require('util');var moment=require(_0x7ae2('0x1'));var BPromise=require(_0x7ae2('0x2'));var rs=require(_0x7ae2('0x3'));var fs=require('fs');var Redis=require(_0x7ae2('0x4'));var db=require(_0x7ae2('0x5'))['db'];var utils=require(_0x7ae2('0x6'));var logger=require(_0x7ae2('0x7'))(_0x7ae2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7ae2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9f16c9,_0x5ededd,_0x5ca0f6){return new BPromise(function(_0x43c2ed,_0x5706fb){return client[_0x7ae2('0xa')](_0x9f16c9,_0x5ca0f6)[_0x7ae2('0xb')](function(_0x371b5d){logger[_0x7ae2('0xc')](_0x7ae2('0xd'),_0x5ededd,_0x7ae2('0xe'));logger[_0x7ae2('0xf')](_0x7ae2('0x10'),_0x5ededd,_0x7ae2('0xe'),JSON[_0x7ae2('0x11')](_0x371b5d));if(_0x371b5d[_0x7ae2('0x12')]){if(_0x371b5d[_0x7ae2('0x12')][_0x7ae2('0x13')]===0x1f4){logger[_0x7ae2('0x12')](_0x7ae2('0xd'),_0x5ededd,_0x371b5d[_0x7ae2('0x12')][_0x7ae2('0x14')]);return _0x5706fb(_0x371b5d[_0x7ae2('0x12')][_0x7ae2('0x14')]);}logger['error'](_0x7ae2('0xd'),_0x5ededd,_0x371b5d['error'][_0x7ae2('0x14')]);return _0x43c2ed(_0x371b5d[_0x7ae2('0x12')]['message']);}else{logger[_0x7ae2('0xc')](_0x7ae2('0xd'),_0x5ededd,_0x7ae2('0xe'));_0x43c2ed(_0x371b5d[_0x7ae2('0x15')][_0x7ae2('0x14')]);}})[_0x7ae2('0x16')](function(_0x31be43){logger['error'](_0x7ae2('0xd'),_0x5ededd,_0x31be43);_0x5706fb(_0x31be43);});});}