Built motion from commit (unavailable).|2.4.17
[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 _0x57f4=['request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x2714ce,_0x4214b3){var _0x1d5cba=function(_0x321964){while(--_0x321964){_0x2714ce['push'](_0x2714ce['shift']());}};_0x1d5cba(++_0x4214b3);}(_0x57f4,0xb8));var _0x457f=function(_0x5f3512,_0x4b99ac){_0x5f3512=_0x5f3512-0x0;var _0x51474d=_0x57f4[_0x5f3512];return _0x51474d;};'use strict';var _=require(_0x457f('0x0'));var util=require('util');var moment=require(_0x457f('0x1'));var BPromise=require('bluebird');var rs=require(_0x457f('0x2'));var fs=require('fs');var Redis=require(_0x457f('0x3'));var db=require(_0x457f('0x4'))['db'];var utils=require(_0x457f('0x5'));var logger=require('../../config/logger')(_0x457f('0x6'));var config=require(_0x457f('0x7'));var jayson=require(_0x457f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2871be,_0x432507,_0x49995b){return new BPromise(function(_0x24447b,_0x1ea690){return client[_0x457f('0x9')](_0x2871be,_0x49995b)[_0x457f('0xa')](function(_0x2c74ad){logger['info'](_0x457f('0xb'),_0x432507,'request\x20sent');logger[_0x457f('0xc')](_0x457f('0xd'),_0x432507,_0x457f('0xe'),JSON[_0x457f('0xf')](_0x2c74ad));if(_0x2c74ad[_0x457f('0x10')]){if(_0x2c74ad[_0x457f('0x10')][_0x457f('0x11')]===0x1f4){logger['error'](_0x457f('0xb'),_0x432507,_0x2c74ad[_0x457f('0x10')][_0x457f('0x12')]);return _0x1ea690(_0x2c74ad[_0x457f('0x10')][_0x457f('0x12')]);}logger[_0x457f('0x10')](_0x457f('0xb'),_0x432507,_0x2c74ad[_0x457f('0x10')][_0x457f('0x12')]);return _0x24447b(_0x2c74ad[_0x457f('0x10')][_0x457f('0x12')]);}else{logger[_0x457f('0x13')](_0x457f('0xb'),_0x432507,_0x457f('0xe'));_0x24447b(_0x2c74ad[_0x457f('0x14')][_0x457f('0x12')]);}})[_0x457f('0x15')](function(_0x18e8c2){logger[_0x457f('0x10')](_0x457f('0xb'),_0x432507,_0x18e8c2);_0x1ea690(_0x18e8c2);});});}