d14833159bc5e23b3a1dad5e4453d38d76915d00
[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 _0xdaaf=['message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x48415d,_0x339044){var _0x2f6650=function(_0x40b2d4){while(--_0x40b2d4){_0x48415d['push'](_0x48415d['shift']());}};_0x2f6650(++_0x339044);}(_0xdaaf,0x130));var _0xfdaa=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdaaf[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xfdaa('0x0'));var moment=require(_0xfdaa('0x1'));var BPromise=require(_0xfdaa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfdaa('0x3'));var db=require(_0xfdaa('0x4'))['db'];var utils=require(_0xfdaa('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfdaa('0x6')][_0xfdaa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x49da41,_0x22d2c5,_0xde4ecd){return new BPromise(function(_0x74474f,_0x1ac37b){return client[_0xfdaa('0x8')](_0x49da41,_0xde4ecd)[_0xfdaa('0x9')](function(_0x53d2eb){logger['info'](_0xfdaa('0xa'),_0x22d2c5,_0xfdaa('0xb'));logger[_0xfdaa('0xc')](_0xfdaa('0xd'),_0x22d2c5,_0xfdaa('0xb'),JSON['stringify'](_0x53d2eb));if(_0x53d2eb['error']){if(_0x53d2eb[_0xfdaa('0xe')][_0xfdaa('0xf')]===0x1f4){logger['error'](_0xfdaa('0xa'),_0x22d2c5,_0x53d2eb[_0xfdaa('0xe')][_0xfdaa('0x10')]);return _0x1ac37b(_0x53d2eb['error'][_0xfdaa('0x10')]);}logger['error'](_0xfdaa('0xa'),_0x22d2c5,_0x53d2eb[_0xfdaa('0xe')][_0xfdaa('0x10')]);return _0x74474f(_0x53d2eb[_0xfdaa('0xe')][_0xfdaa('0x10')]);}else{logger[_0xfdaa('0x11')](_0xfdaa('0xa'),_0x22d2c5,'request\x20sent');_0x74474f(_0x53d2eb[_0xfdaa('0x12')][_0xfdaa('0x10')]);}})[_0xfdaa('0x13')](function(_0x44a556){logger[_0xfdaa('0xe')](_0xfdaa('0xa'),_0x22d2c5,_0x44a556);_0x1ac37b(_0x44a556);});});}