6f7f1e8ffc76a1f348951a90e91cfa01f709ca99
[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 _0x2d2f=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result'];(function(_0x3b21f7,_0x278ae8){var _0x39b0da=function(_0x206036){while(--_0x206036){_0x3b21f7['push'](_0x3b21f7['shift']());}};_0x39b0da(++_0x278ae8);}(_0x2d2f,0x139));var _0xf2d2=function(_0x5966dc,_0x30e203){_0x5966dc=_0x5966dc-0x0;var _0x20d1c2=_0x2d2f[_0x5966dc];return _0x20d1c2;};'use strict';var _=require(_0xf2d2('0x0'));var util=require(_0xf2d2('0x1'));var moment=require('moment');var BPromise=require(_0xf2d2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2d2('0x3'));var db=require(_0xf2d2('0x4'))['db'];var utils=require(_0xf2d2('0x5'));var logger=require(_0xf2d2('0x6'))(_0xf2d2('0x7'));var config=require(_0xf2d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf2d2('0x9')][_0xf2d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ae3be,_0x399681,_0x202437){return new BPromise(function(_0x47c0c7,_0x81eec5){return client[_0xf2d2('0xb')](_0x4ae3be,_0x202437)[_0xf2d2('0xc')](function(_0x425922){logger[_0xf2d2('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x399681,_0xf2d2('0xe'));logger[_0xf2d2('0xf')](_0xf2d2('0x10'),_0x399681,_0xf2d2('0xe'),JSON[_0xf2d2('0x11')](_0x425922));if(_0x425922['error']){if(_0x425922[_0xf2d2('0x12')][_0xf2d2('0x13')]===0x1f4){logger['error'](_0xf2d2('0x14'),_0x399681,_0x425922[_0xf2d2('0x12')]['message']);return _0x81eec5(_0x425922['error'][_0xf2d2('0x15')]);}logger[_0xf2d2('0x12')](_0xf2d2('0x14'),_0x399681,_0x425922[_0xf2d2('0x12')][_0xf2d2('0x15')]);return _0x47c0c7(_0x425922[_0xf2d2('0x12')]['message']);}else{logger[_0xf2d2('0xd')](_0xf2d2('0x14'),_0x399681,'request\x20sent');_0x47c0c7(_0x425922[_0xf2d2('0x16')]['message']);}})[_0xf2d2('0x17')](function(_0x212517){logger[_0xf2d2('0x12')](_0xf2d2('0x14'),_0x399681,_0x212517);_0x81eec5(_0x212517);});});}