Built motion from commit (unavailable).|2.5.22
[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 _0x8bef=['message','ZendeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5d1acd,_0x1a6401){var _0x1b68dd=function(_0xa8b274){while(--_0xa8b274){_0x5d1acd['push'](_0x5d1acd['shift']());}};_0x1b68dd(++_0x1a6401);}(_0x8bef,0x76));var _0xf8be=function(_0x2a9153,_0x44fd73){_0x2a9153=_0x2a9153-0x0;var _0x2f6615=_0x8bef[_0x2a9153];return _0x2f6615;};'use strict';var _=require(_0xf8be('0x0'));var util=require(_0xf8be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8be('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8be('0x3'))['db'];var utils=require(_0xf8be('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf8be('0x5'));var jayson=require(_0xf8be('0x6'));var client=jayson[_0xf8be('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47b48a,_0x3b3a46,_0x5d0c0e){return new BPromise(function(_0x11f54e,_0x496c6f){return client['request'](_0x47b48a,_0x5d0c0e)[_0xf8be('0x8')](function(_0x4f5d14){logger[_0xf8be('0x9')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3b3a46,_0xf8be('0xa'));logger['debug'](_0xf8be('0xb'),_0x3b3a46,_0xf8be('0xa'),JSON[_0xf8be('0xc')](_0x4f5d14));if(_0x4f5d14[_0xf8be('0xd')]){if(_0x4f5d14['error'][_0xf8be('0xe')]===0x1f4){logger[_0xf8be('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3b3a46,_0x4f5d14[_0xf8be('0xd')][_0xf8be('0xf')]);return _0x496c6f(_0x4f5d14[_0xf8be('0xd')][_0xf8be('0xf')]);}logger['error'](_0xf8be('0x10'),_0x3b3a46,_0x4f5d14['error'][_0xf8be('0xf')]);return _0x11f54e(_0x4f5d14['error'][_0xf8be('0xf')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x3b3a46,_0xf8be('0xa'));_0x11f54e(_0x4f5d14[_0xf8be('0x11')][_0xf8be('0xf')]);}})[_0xf8be('0x12')](function(_0xc213df){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x3b3a46,_0xc213df);_0x496c6f(_0xc213df);});});}