177f7f17b4a6672a5626d55f9678f87de618747c
[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 _0x7a65=['../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x835cb7,_0x1e574d){var _0x3ef599=function(_0x2874f2){while(--_0x2874f2){_0x835cb7['push'](_0x835cb7['shift']());}};_0x3ef599(++_0x1e574d);}(_0x7a65,0x1f4));var _0x57a6=function(_0x470872,_0x40543f){_0x470872=_0x470872-0x0;var _0x41eb87=_0x7a65[_0x470872];return _0x41eb87;};'use strict';var _=require(_0x57a6('0x0'));var util=require('util');var moment=require(_0x57a6('0x1'));var BPromise=require(_0x57a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57a6('0x3'));var db=require(_0x57a6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x57a6('0x5'));var config=require(_0x57a6('0x6'));var jayson=require(_0x57a6('0x7'));var client=jayson[_0x57a6('0x8')][_0x57a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42aac5,_0x20f166,_0x11e725){return new BPromise(function(_0x1291d5,_0x104f4a){return client[_0x57a6('0xa')](_0x42aac5,_0x11e725)[_0x57a6('0xb')](function(_0x355de0){logger[_0x57a6('0xc')](_0x57a6('0xd'),_0x20f166,_0x57a6('0xe'));logger[_0x57a6('0xf')](_0x57a6('0x10'),_0x20f166,_0x57a6('0xe'),JSON[_0x57a6('0x11')](_0x355de0));if(_0x355de0[_0x57a6('0x12')]){if(_0x355de0[_0x57a6('0x12')][_0x57a6('0x13')]===0x1f4){logger['error'](_0x57a6('0xd'),_0x20f166,_0x355de0[_0x57a6('0x12')][_0x57a6('0x14')]);return _0x104f4a(_0x355de0['error'][_0x57a6('0x14')]);}logger[_0x57a6('0x12')](_0x57a6('0xd'),_0x20f166,_0x355de0[_0x57a6('0x12')][_0x57a6('0x14')]);return _0x1291d5(_0x355de0[_0x57a6('0x12')]['message']);}else{logger[_0x57a6('0xc')](_0x57a6('0xd'),_0x20f166,_0x57a6('0xe'));_0x1291d5(_0x355de0[_0x57a6('0x15')]['message']);}})[_0x57a6('0x16')](function(_0x836929){logger[_0x57a6('0x12')](_0x57a6('0xd'),_0x20f166,_0x836929);_0x104f4a(_0x836929);});});}