Built motion from commit d5e4af8c.|2.6.23
[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 _0x5e58=['result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','code','error','message'];(function(_0x215a40,_0x3f978f){var _0x403e9f=function(_0x5be04d){while(--_0x5be04d){_0x215a40['push'](_0x215a40['shift']());}};_0x403e9f(++_0x3f978f);}(_0x5e58,0x105));var _0x85e5=function(_0x30c57f,_0x4e26ca){_0x30c57f=_0x30c57f-0x0;var _0x570756=_0x5e58[_0x30c57f];return _0x570756;};'use strict';var _=require(_0x85e5('0x0'));var util=require('util');var moment=require(_0x85e5('0x1'));var BPromise=require(_0x85e5('0x2'));var rs=require(_0x85e5('0x3'));var fs=require('fs');var Redis=require(_0x85e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x85e5('0x5'))(_0x85e5('0x6'));var config=require(_0x85e5('0x7'));var jayson=require(_0x85e5('0x8'));var client=jayson[_0x85e5('0x9')][_0x85e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11320b,_0x549a4c,_0x4a60a6){return new BPromise(function(_0xae077b,_0x3b3dd7){return client['request'](_0x11320b,_0x4a60a6)[_0x85e5('0xb')](function(_0x4c1f5d){logger[_0x85e5('0xc')](_0x85e5('0xd'),_0x549a4c,_0x85e5('0xe'));logger[_0x85e5('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x549a4c,'request\x20sent',JSON['stringify'](_0x4c1f5d));if(_0x4c1f5d['error']){if(_0x4c1f5d['error'][_0x85e5('0x10')]===0x1f4){logger[_0x85e5('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x549a4c,_0x4c1f5d['error'][_0x85e5('0x12')]);return _0x3b3dd7(_0x4c1f5d['error'][_0x85e5('0x12')]);}logger[_0x85e5('0x11')](_0x85e5('0xd'),_0x549a4c,_0x4c1f5d[_0x85e5('0x11')]['message']);return _0xae077b(_0x4c1f5d[_0x85e5('0x11')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x549a4c,_0x85e5('0xe'));_0xae077b(_0x4c1f5d[_0x85e5('0x13')][_0x85e5('0x12')]);}})['catch'](function(_0x2b23c6){logger[_0x85e5('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x549a4c,_0x2b23c6);_0x3b3dd7(_0x2b23c6);});});}