6ec00aa85246f2d9053c47b421fd065784a6b4a5
[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 _0xbd5b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','code','error','message','info','catch','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x4bb97d,_0x582088){var _0x4d54a4=function(_0x3c7320){while(--_0x3c7320){_0x4bb97d['push'](_0x4bb97d['shift']());}};_0x4d54a4(++_0x582088);}(_0xbd5b,0x1b8));var _0xbbd5=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xbd5b[_0xe73080];return _0x12cbc4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbbd5('0x0'));var BPromise=require(_0xbbd5('0x1'));var rs=require(_0xbbd5('0x2'));var fs=require('fs');var Redis=require(_0xbbd5('0x3'));var db=require(_0xbbd5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbd5('0x5'))(_0xbbd5('0x6'));var config=require(_0xbbd5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbbd5('0x8')][_0xbbd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3890b0,_0x3a0526,_0x5ef2c4){return new BPromise(function(_0x3ca3c3,_0x1b091b){return client[_0xbbd5('0xa')](_0x3890b0,_0x5ef2c4)[_0xbbd5('0xb')](function(_0x501fda){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x3a0526,_0xbbd5('0xc'));logger[_0xbbd5('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3a0526,_0xbbd5('0xc'),JSON['stringify'](_0x501fda));if(_0x501fda['error']){if(_0x501fda['error'][_0xbbd5('0xe')]===0x1f4){logger[_0xbbd5('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a0526,_0x501fda[_0xbbd5('0xf')]['message']);return _0x1b091b(_0x501fda['error']['message']);}logger[_0xbbd5('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a0526,_0x501fda['error'][_0xbbd5('0x10')]);return _0x3ca3c3(_0x501fda['error']['message']);}else{logger[_0xbbd5('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a0526,_0xbbd5('0xc'));_0x3ca3c3(_0x501fda['result']['message']);}})[_0xbbd5('0x12')](function(_0x58d31a){logger['error'](_0xbbd5('0x13'),_0x3a0526,_0x58d31a);_0x1b091b(_0x58d31a);});});}