Built motion from commit da617fac.|2.6.6
[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 _0xd85c=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','request','info'];(function(_0xf90544,_0x211f7a){var _0x22b0ed=function(_0x1f805e){while(--_0x1f805e){_0xf90544['push'](_0xf90544['shift']());}};_0x22b0ed(++_0x211f7a);}(_0xd85c,0x15f));var _0xcd85=function(_0x230471,_0x10441f){_0x230471=_0x230471-0x0;var _0x5dd908=_0xd85c[_0x230471];return _0x5dd908;};'use strict';var _=require(_0xcd85('0x0'));var util=require(_0xcd85('0x1'));var moment=require('moment');var BPromise=require(_0xcd85('0x2'));var rs=require(_0xcd85('0x3'));var fs=require('fs');var Redis=require(_0xcd85('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd85('0x5'));var logger=require('../../config/logger')(_0xcd85('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33772b,_0x19d8ab,_0x5ea014){return new BPromise(function(_0x26acb9,_0x565039){return client[_0xcd85('0x7')](_0x33772b,_0x5ea014)['then'](function(_0xda6c0e){logger[_0xcd85('0x8')](_0xcd85('0x9'),_0x19d8ab,_0xcd85('0xa'));logger[_0xcd85('0xb')](_0xcd85('0xc'),_0x19d8ab,'request\x20sent',JSON[_0xcd85('0xd')](_0xda6c0e));if(_0xda6c0e['error']){if(_0xda6c0e[_0xcd85('0xe')][_0xcd85('0xf')]===0x1f4){logger[_0xcd85('0xe')](_0xcd85('0x9'),_0x19d8ab,_0xda6c0e[_0xcd85('0xe')]['message']);return _0x565039(_0xda6c0e[_0xcd85('0xe')]['message']);}logger[_0xcd85('0xe')](_0xcd85('0x9'),_0x19d8ab,_0xda6c0e[_0xcd85('0xe')]['message']);return _0x26acb9(_0xda6c0e[_0xcd85('0xe')][_0xcd85('0x10')]);}else{logger[_0xcd85('0x8')](_0xcd85('0x9'),_0x19d8ab,'request\x20sent');_0x26acb9(_0xda6c0e[_0xcd85('0x11')][_0xcd85('0x10')]);}})['catch'](function(_0x59bf62){logger[_0xcd85('0xe')](_0xcd85('0x9'),_0x19d8ab,_0x59bf62);_0x565039(_0x59bf62);});});}