6c8e3ccd72d96f5f32606b9bc3eabf3e9e54a06e
[motion2.git] / server / api / intServicenowConfiguration / intServicenowConfiguration.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 _0xf771=['http','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5ac17d,_0x3c9f09){var _0x5c6f7b=function(_0x43637a){while(--_0x43637a){_0x5ac17d['push'](_0x5ac17d['shift']());}};_0x5c6f7b(++_0x3c9f09);}(_0xf771,0x8e));var _0x1f77=function(_0x4b03b5,_0x59807c){_0x4b03b5=_0x4b03b5-0x0;var _0x24d8b7=_0xf771[_0x4b03b5];return _0x24d8b7;};'use strict';var _=require(_0x1f77('0x0'));var util=require(_0x1f77('0x1'));var moment=require(_0x1f77('0x2'));var BPromise=require(_0x1f77('0x3'));var rs=require(_0x1f77('0x4'));var fs=require('fs');var Redis=require(_0x1f77('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f77('0x6'));var logger=require(_0x1f77('0x7'))(_0x1f77('0x8'));var config=require(_0x1f77('0x9'));var jayson=require(_0x1f77('0xa'));var client=jayson[_0x1f77('0xb')][_0x1f77('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53619b,_0x28509c,_0x140d3d){return new BPromise(function(_0x179b74,_0x4704ed){return client['request'](_0x53619b,_0x140d3d)[_0x1f77('0xd')](function(_0x392c37){logger[_0x1f77('0xe')](_0x1f77('0xf'),_0x28509c,'request\x20sent');logger[_0x1f77('0x10')](_0x1f77('0x11'),_0x28509c,_0x1f77('0x12'),JSON['stringify'](_0x392c37));if(_0x392c37[_0x1f77('0x13')]){if(_0x392c37[_0x1f77('0x13')][_0x1f77('0x14')]===0x1f4){logger[_0x1f77('0x13')](_0x1f77('0xf'),_0x28509c,_0x392c37[_0x1f77('0x13')][_0x1f77('0x15')]);return _0x4704ed(_0x392c37[_0x1f77('0x13')][_0x1f77('0x15')]);}logger[_0x1f77('0x13')](_0x1f77('0xf'),_0x28509c,_0x392c37[_0x1f77('0x13')][_0x1f77('0x15')]);return _0x179b74(_0x392c37[_0x1f77('0x13')][_0x1f77('0x15')]);}else{logger[_0x1f77('0xe')](_0x1f77('0xf'),_0x28509c,'request\x20sent');_0x179b74(_0x392c37['result']['message']);}})['catch'](function(_0x17e901){logger[_0x1f77('0x13')](_0x1f77('0xf'),_0x28509c,_0x17e901);_0x4704ed(_0x17e901);});});}