9d3bebc0058b1d6c1682015b6355ae0b3c2fc59d
[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 _0x0002=['stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x417cc3,_0x5c0723){var _0x3d2e81=function(_0x489261){while(--_0x489261){_0x417cc3['push'](_0x417cc3['shift']());}};_0x3d2e81(++_0x5c0723);}(_0x0002,0xd7));var _0x2000=function(_0x899b81,_0x40d5f6){_0x899b81=_0x899b81-0x0;var _0x1bcd7b=_0x0002[_0x899b81];return _0x1bcd7b;};'use strict';var _=require('lodash');var util=require(_0x2000('0x0'));var moment=require(_0x2000('0x1'));var BPromise=require(_0x2000('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2000('0x3'));var db=require(_0x2000('0x4'))['db'];var utils=require(_0x2000('0x5'));var logger=require(_0x2000('0x6'))('rpc');var config=require(_0x2000('0x7'));var jayson=require(_0x2000('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x653d27,_0x5cd89d,_0x617af9){return new BPromise(function(_0x41a950,_0x2b1d41){return client[_0x2000('0x9')](_0x653d27,_0x617af9)[_0x2000('0xa')](function(_0x50e128){logger[_0x2000('0xb')](_0x2000('0xc'),_0x5cd89d,'request\x20sent');logger[_0x2000('0xd')](_0x2000('0xe'),_0x5cd89d,_0x2000('0xf'),JSON[_0x2000('0x10')](_0x50e128));if(_0x50e128[_0x2000('0x11')]){if(_0x50e128[_0x2000('0x11')][_0x2000('0x12')]===0x1f4){logger[_0x2000('0x11')](_0x2000('0xc'),_0x5cd89d,_0x50e128[_0x2000('0x11')]['message']);return _0x2b1d41(_0x50e128[_0x2000('0x11')][_0x2000('0x13')]);}logger[_0x2000('0x11')](_0x2000('0xc'),_0x5cd89d,_0x50e128['error'][_0x2000('0x13')]);return _0x41a950(_0x50e128[_0x2000('0x11')][_0x2000('0x13')]);}else{logger[_0x2000('0xb')](_0x2000('0xc'),_0x5cd89d,_0x2000('0xf'));_0x41a950(_0x50e128['result'][_0x2000('0x13')]);}})[_0x2000('0x14')](function(_0x23ad3d){logger[_0x2000('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5cd89d,_0x23ad3d);_0x2b1d41(_0x23ad3d);});});}