Built motion from commit (unavailable).|2.2.0
[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 _0x5443=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug'];(function(_0x4e9ed3,_0x40c07c){var _0x717b59=function(_0x12b1bb){while(--_0x12b1bb){_0x4e9ed3['push'](_0x4e9ed3['shift']());}};_0x717b59(++_0x40c07c);}(_0x5443,0x81));var _0x3544=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5443[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x3544('0x0'));var util=require(_0x3544('0x1'));var moment=require(_0x3544('0x2'));var BPromise=require(_0x3544('0x3'));var rs=require(_0x3544('0x4'));var fs=require('fs');var Redis=require(_0x3544('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3544('0x6'));var logger=require('../../config/logger')(_0x3544('0x7'));var config=require(_0x3544('0x8'));var jayson=require(_0x3544('0x9'));var client=jayson['client'][_0x3544('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed926,_0x697920,_0x22e0e2){return new BPromise(function(_0x69c64f,_0x59ef2a){return client[_0x3544('0xb')](_0x5ed926,_0x22e0e2)[_0x3544('0xc')](function(_0x54ff12){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x697920,_0x3544('0xd'));logger[_0x3544('0xe')](_0x3544('0xf'),_0x697920,_0x3544('0xd'),JSON[_0x3544('0x10')](_0x54ff12));if(_0x54ff12[_0x3544('0x11')]){if(_0x54ff12['error'][_0x3544('0x12')]===0x1f4){logger[_0x3544('0x11')](_0x3544('0x13'),_0x697920,_0x54ff12['error'][_0x3544('0x14')]);return _0x59ef2a(_0x54ff12[_0x3544('0x11')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x697920,_0x54ff12['error'][_0x3544('0x14')]);return _0x69c64f(_0x54ff12[_0x3544('0x11')][_0x3544('0x14')]);}else{logger[_0x3544('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x697920,'request\x20sent');_0x69c64f(_0x54ff12[_0x3544('0x16')]['message']);}})[_0x3544('0x17')](function(_0x187d59){logger['error'](_0x3544('0x13'),_0x697920,_0x187d59);_0x59ef2a(_0x187d59);});});}