9a2ea8b3c1038fe20c6434117be495476a511502
[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 _0xf875=['util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5dba1a,_0xb9f9d6){var _0x3a70f7=function(_0x2c9321){while(--_0x2c9321){_0x5dba1a['push'](_0x5dba1a['shift']());}};_0x3a70f7(++_0xb9f9d6);}(_0xf875,0x1a1));var _0x5f87=function(_0x5c049a,_0x2c1263){_0x5c049a=_0x5c049a-0x0;var _0x168e70=_0xf875[_0x5c049a];return _0x168e70;};'use strict';var _=require(_0x5f87('0x0'));var util=require(_0x5f87('0x1'));var moment=require('moment');var BPromise=require(_0x5f87('0x2'));var rs=require(_0x5f87('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f87('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f87('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5f87('0x6'));var client=jayson[_0x5f87('0x7')][_0x5f87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cd623,_0x4f44d1,_0x154929){return new BPromise(function(_0x12f07d,_0x5ed310){return client[_0x5f87('0x9')](_0x5cd623,_0x154929)[_0x5f87('0xa')](function(_0x315416){logger[_0x5f87('0xb')](_0x5f87('0xc'),_0x4f44d1,_0x5f87('0xd'));logger[_0x5f87('0xe')](_0x5f87('0xf'),_0x4f44d1,_0x5f87('0xd'),JSON[_0x5f87('0x10')](_0x315416));if(_0x315416[_0x5f87('0x11')]){if(_0x315416[_0x5f87('0x11')][_0x5f87('0x12')]===0x1f4){logger[_0x5f87('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4f44d1,_0x315416[_0x5f87('0x11')][_0x5f87('0x13')]);return _0x5ed310(_0x315416[_0x5f87('0x11')][_0x5f87('0x13')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4f44d1,_0x315416[_0x5f87('0x11')][_0x5f87('0x13')]);return _0x12f07d(_0x315416['error'][_0x5f87('0x13')]);}else{logger[_0x5f87('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4f44d1,_0x5f87('0xd'));_0x12f07d(_0x315416[_0x5f87('0x14')]['message']);}})[_0x5f87('0x15')](function(_0x57eb95){logger[_0x5f87('0x11')](_0x5f87('0xc'),_0x4f44d1,_0x57eb95);_0x5ed310(_0x57eb95);});});}