6c4b986dd70fbdc5cc867885c37659553752b4a8
[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 _0xbbf1=['client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x50054d,_0x38ecaf){var _0x34bceb=function(_0x285574){while(--_0x285574){_0x50054d['push'](_0x50054d['shift']());}};_0x34bceb(++_0x38ecaf);}(_0xbbf1,0x17d));var _0x1bbf=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbbf1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1bbf('0x0'));var util=require(_0x1bbf('0x1'));var moment=require('moment');var BPromise=require(_0x1bbf('0x2'));var rs=require(_0x1bbf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1bbf('0x4'))['db'];var utils=require(_0x1bbf('0x5'));var logger=require(_0x1bbf('0x6'))(_0x1bbf('0x7'));var config=require(_0x1bbf('0x8'));var jayson=require(_0x1bbf('0x9'));var client=jayson[_0x1bbf('0xa')][_0x1bbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4116eb,_0x147873,_0x1e9af1){return new BPromise(function(_0x414ed3,_0x3feab7){return client[_0x1bbf('0xc')](_0x4116eb,_0x1e9af1)[_0x1bbf('0xd')](function(_0x2224b9){logger[_0x1bbf('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x147873,_0x1bbf('0xf'));logger[_0x1bbf('0x10')](_0x1bbf('0x11'),_0x147873,_0x1bbf('0xf'),JSON['stringify'](_0x2224b9));if(_0x2224b9['error']){if(_0x2224b9[_0x1bbf('0x12')]['code']===0x1f4){logger[_0x1bbf('0x12')](_0x1bbf('0x13'),_0x147873,_0x2224b9[_0x1bbf('0x12')][_0x1bbf('0x14')]);return _0x3feab7(_0x2224b9[_0x1bbf('0x12')]['message']);}logger[_0x1bbf('0x12')](_0x1bbf('0x13'),_0x147873,_0x2224b9[_0x1bbf('0x12')]['message']);return _0x414ed3(_0x2224b9[_0x1bbf('0x12')][_0x1bbf('0x14')]);}else{logger[_0x1bbf('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x147873,_0x1bbf('0xf'));_0x414ed3(_0x2224b9[_0x1bbf('0x15')]['message']);}})[_0x1bbf('0x16')](function(_0x298dbf){logger[_0x1bbf('0x12')](_0x1bbf('0x13'),_0x147873,_0x298dbf);_0x3feab7(_0x298dbf);});});}