Built motion from commit (unavailable).|2.5.13
[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 _0x19f8=['ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1f69ad,_0x5d97d5){var _0x3a4161=function(_0x65f309){while(--_0x65f309){_0x1f69ad['push'](_0x1f69ad['shift']());}};_0x3a4161(++_0x5d97d5);}(_0x19f8,0xa3));var _0x819f=function(_0x2a8444,_0xb5ee31){_0x2a8444=_0x2a8444-0x0;var _0x53c724=_0x19f8[_0x2a8444];return _0x53c724;};'use strict';var _=require(_0x819f('0x0'));var util=require(_0x819f('0x1'));var moment=require(_0x819f('0x2'));var BPromise=require(_0x819f('0x3'));var rs=require(_0x819f('0x4'));var fs=require('fs');var Redis=require(_0x819f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x819f('0x6'));var config=require(_0x819f('0x7'));var jayson=require(_0x819f('0x8'));var client=jayson[_0x819f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x395f44,_0x575900,_0x1dfc42){return new BPromise(function(_0x224e19,_0x12aa5d){return client[_0x819f('0xa')](_0x395f44,_0x1dfc42)[_0x819f('0xb')](function(_0xfe0591){logger[_0x819f('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x575900,'request\x20sent');logger[_0x819f('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x575900,_0x819f('0xe'),JSON['stringify'](_0xfe0591));if(_0xfe0591[_0x819f('0xf')]){if(_0xfe0591[_0x819f('0xf')][_0x819f('0x10')]===0x1f4){logger[_0x819f('0xf')](_0x819f('0x11'),_0x575900,_0xfe0591[_0x819f('0xf')][_0x819f('0x12')]);return _0x12aa5d(_0xfe0591[_0x819f('0xf')][_0x819f('0x12')]);}logger[_0x819f('0xf')](_0x819f('0x11'),_0x575900,_0xfe0591['error'][_0x819f('0x12')]);return _0x224e19(_0xfe0591[_0x819f('0xf')][_0x819f('0x12')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x575900,_0x819f('0xe'));_0x224e19(_0xfe0591[_0x819f('0x13')][_0x819f('0x12')]);}})[_0x819f('0x14')](function(_0x4432d5){logger[_0x819f('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x575900,_0x4432d5);_0x12aa5d(_0x4432d5);});});}