Built motion from commit (unavailable).|2.5.1
[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 _0x28d3=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2f4565,_0x5ed91c){var _0x555412=function(_0x59553b){while(--_0x59553b){_0x2f4565['push'](_0x2f4565['shift']());}};_0x555412(++_0x5ed91c);}(_0x28d3,0x154));var _0x328d=function(_0x19f519,_0x18a957){_0x19f519=_0x19f519-0x0;var _0x1b028a=_0x28d3[_0x19f519];return _0x1b028a;};'use strict';var _=require(_0x328d('0x0'));var util=require(_0x328d('0x1'));var moment=require(_0x328d('0x2'));var BPromise=require(_0x328d('0x3'));var rs=require(_0x328d('0x4'));var fs=require('fs');var Redis=require(_0x328d('0x5'));var db=require(_0x328d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x328d('0x7'))('rpc');var config=require(_0x328d('0x8'));var jayson=require(_0x328d('0x9'));var client=jayson[_0x328d('0xa')][_0x328d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5159a5,_0x762d7e,_0x12095b){return new BPromise(function(_0x18fab9,_0x49df30){return client[_0x328d('0xc')](_0x5159a5,_0x12095b)[_0x328d('0xd')](function(_0x1db82f){logger[_0x328d('0xe')](_0x328d('0xf'),_0x762d7e,'request\x20sent');logger[_0x328d('0x10')](_0x328d('0x11'),_0x762d7e,'request\x20sent',JSON[_0x328d('0x12')](_0x1db82f));if(_0x1db82f[_0x328d('0x13')]){if(_0x1db82f['error'][_0x328d('0x14')]===0x1f4){logger['error'](_0x328d('0xf'),_0x762d7e,_0x1db82f[_0x328d('0x13')][_0x328d('0x15')]);return _0x49df30(_0x1db82f[_0x328d('0x13')][_0x328d('0x15')]);}logger[_0x328d('0x13')](_0x328d('0xf'),_0x762d7e,_0x1db82f[_0x328d('0x13')][_0x328d('0x15')]);return _0x18fab9(_0x1db82f[_0x328d('0x13')][_0x328d('0x15')]);}else{logger[_0x328d('0xe')](_0x328d('0xf'),_0x762d7e,'request\x20sent');_0x18fab9(_0x1db82f['result'][_0x328d('0x15')]);}})[_0x328d('0x16')](function(_0x839d3c){logger[_0x328d('0x13')](_0x328d('0xf'),_0x762d7e,_0x839d3c);_0x49df30(_0x839d3c);});});}