5167fcf90f472c62036c5631bc2c98e32079d632
[motion2.git] / server / api / intZendeskConfiguration / intZendeskConfiguration.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 _0x62fb=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x62fb,0x6c));var _0xb62f=function(_0x1ce2fc,_0x3ab648){_0x1ce2fc=_0x1ce2fc-0x0;var _0x269f03=_0x62fb[_0x1ce2fc];return _0x269f03;};'use strict';var _=require(_0xb62f('0x0'));var util=require('util');var moment=require(_0xb62f('0x1'));var BPromise=require(_0xb62f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb62f('0x3'));var db=require(_0xb62f('0x4'))['db'];var utils=require(_0xb62f('0x5'));var logger=require(_0xb62f('0x6'))(_0xb62f('0x7'));var config=require('../../config/environment');var jayson=require(_0xb62f('0x8'));var client=jayson[_0xb62f('0x9')][_0xb62f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7426da,_0x203b04,_0x5157f4){return new BPromise(function(_0x51d361,_0x6d8c27){return client[_0xb62f('0xb')](_0x7426da,_0x5157f4)[_0xb62f('0xc')](function(_0x58f732){logger[_0xb62f('0xd')](_0xb62f('0xe'),_0x203b04,_0xb62f('0xf'));logger['debug'](_0xb62f('0x10'),_0x203b04,_0xb62f('0xf'),JSON['stringify'](_0x58f732));if(_0x58f732[_0xb62f('0x11')]){if(_0x58f732['error'][_0xb62f('0x12')]===0x1f4){logger[_0xb62f('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x203b04,_0x58f732[_0xb62f('0x11')][_0xb62f('0x13')]);return _0x6d8c27(_0x58f732[_0xb62f('0x11')]['message']);}logger[_0xb62f('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x203b04,_0x58f732[_0xb62f('0x11')][_0xb62f('0x13')]);return _0x51d361(_0x58f732[_0xb62f('0x11')][_0xb62f('0x13')]);}else{logger[_0xb62f('0xd')](_0xb62f('0xe'),_0x203b04,_0xb62f('0xf'));_0x51d361(_0x58f732[_0xb62f('0x14')][_0xb62f('0x13')]);}})[_0xb62f('0x15')](function(_0xbb8069){logger[_0xb62f('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x203b04,_0xbb8069);_0x6d8c27(_0xbb8069);});});}