Built motion from commit 8271bb6f.|2.6.28
[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 _0x3f5b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x3611ef,_0x4fbb05){var _0x246a54=function(_0x2bbd56){while(--_0x2bbd56){_0x3611ef['push'](_0x3611ef['shift']());}};_0x246a54(++_0x4fbb05);}(_0x3f5b,0x1e4));var _0xb3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb3f5('0x0'));var util=require('util');var moment=require(_0xb3f5('0x1'));var BPromise=require(_0xb3f5('0x2'));var rs=require(_0xb3f5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3f5('0x4'))['db'];var utils=require(_0xb3f5('0x5'));var logger=require(_0xb3f5('0x6'))(_0xb3f5('0x7'));var config=require(_0xb3f5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb3f5('0x9')][_0xb3f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcd89ff,_0x253b94,_0x3626ff){return new BPromise(function(_0x1d41f0,_0x36e66d){return client[_0xb3f5('0xb')](_0xcd89ff,_0x3626ff)[_0xb3f5('0xc')](function(_0x5a7529){logger[_0xb3f5('0xd')](_0xb3f5('0xe'),_0x253b94,'request\x20sent');logger[_0xb3f5('0xf')](_0xb3f5('0x10'),_0x253b94,_0xb3f5('0x11'),JSON[_0xb3f5('0x12')](_0x5a7529));if(_0x5a7529[_0xb3f5('0x13')]){if(_0x5a7529[_0xb3f5('0x13')]['code']===0x1f4){logger['error'](_0xb3f5('0xe'),_0x253b94,_0x5a7529[_0xb3f5('0x13')]['message']);return _0x36e66d(_0x5a7529[_0xb3f5('0x13')][_0xb3f5('0x14')]);}logger[_0xb3f5('0x13')]('ZohoField,\x20%s,\x20%s',_0x253b94,_0x5a7529['error'][_0xb3f5('0x14')]);return _0x1d41f0(_0x5a7529[_0xb3f5('0x13')][_0xb3f5('0x14')]);}else{logger[_0xb3f5('0xd')](_0xb3f5('0xe'),_0x253b94,_0xb3f5('0x11'));_0x1d41f0(_0x5a7529[_0xb3f5('0x15')][_0xb3f5('0x14')]);}})[_0xb3f5('0x16')](function(_0x99c1a4){logger[_0xb3f5('0x13')]('ZohoField,\x20%s,\x20%s',_0x253b94,_0x99c1a4);_0x36e66d(_0x99c1a4);});});}