c8f1bc8f4bf0dd093c294a09dde8afcd68e8eead
[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 _0x4c1a=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5219aa,_0x357da6){var _0x479261=function(_0x552e4e){while(--_0x552e4e){_0x5219aa['push'](_0x5219aa['shift']());}};_0x479261(++_0x357da6);}(_0x4c1a,0xd6));var _0xa4c1=function(_0x4ed525,_0x4b1fa1){_0x4ed525=_0x4ed525-0x0;var _0x486131=_0x4c1a[_0x4ed525];return _0x486131;};'use strict';var _=require(_0xa4c1('0x0'));var util=require(_0xa4c1('0x1'));var moment=require(_0xa4c1('0x2'));var BPromise=require(_0xa4c1('0x3'));var rs=require(_0xa4c1('0x4'));var fs=require('fs');var Redis=require(_0xa4c1('0x5'));var db=require(_0xa4c1('0x6'))['db'];var utils=require(_0xa4c1('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa4c1('0x8'));var client=jayson[_0xa4c1('0x9')][_0xa4c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c8b3e,_0x3f3e65,_0xe27d29){return new BPromise(function(_0x4fc89e,_0x56f9b9){return client[_0xa4c1('0xb')](_0x3c8b3e,_0xe27d29)['then'](function(_0x368ff6){logger[_0xa4c1('0xc')](_0xa4c1('0xd'),_0x3f3e65,_0xa4c1('0xe'));logger['debug'](_0xa4c1('0xf'),_0x3f3e65,'request\x20sent',JSON[_0xa4c1('0x10')](_0x368ff6));if(_0x368ff6['error']){if(_0x368ff6[_0xa4c1('0x11')][_0xa4c1('0x12')]===0x1f4){logger[_0xa4c1('0x11')](_0xa4c1('0xd'),_0x3f3e65,_0x368ff6['error'][_0xa4c1('0x13')]);return _0x56f9b9(_0x368ff6[_0xa4c1('0x11')][_0xa4c1('0x13')]);}logger[_0xa4c1('0x11')](_0xa4c1('0xd'),_0x3f3e65,_0x368ff6[_0xa4c1('0x11')][_0xa4c1('0x13')]);return _0x4fc89e(_0x368ff6[_0xa4c1('0x11')][_0xa4c1('0x13')]);}else{logger['info'](_0xa4c1('0xd'),_0x3f3e65,_0xa4c1('0xe'));_0x4fc89e(_0x368ff6[_0xa4c1('0x14')][_0xa4c1('0x13')]);}})[_0xa4c1('0x15')](function(_0xe05305){logger[_0xa4c1('0x11')](_0xa4c1('0xd'),_0x3f3e65,_0xe05305);_0x56f9b9(_0xe05305);});});}