247c53bb9d0cfb0a4d63177e6c03fe0f54bca3e1
[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 _0x134d=['../../config/utils','../../config/logger','rpc','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1ebee8,_0x1251fc){var _0x46529c=function(_0x4c2fec){while(--_0x4c2fec){_0x1ebee8['push'](_0x1ebee8['shift']());}};_0x46529c(++_0x1251fc);}(_0x134d,0x8d));var _0xd134=function(_0x71174c,_0x42a7d6){_0x71174c=_0x71174c-0x0;var _0x4b6b9d=_0x134d[_0x71174c];return _0x4b6b9d;};'use strict';var _=require(_0xd134('0x0'));var util=require(_0xd134('0x1'));var moment=require(_0xd134('0x2'));var BPromise=require(_0xd134('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd134('0x4'));var db=require(_0xd134('0x5'))['db'];var utils=require(_0xd134('0x6'));var logger=require(_0xd134('0x7'))(_0xd134('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd134('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1290f6,_0x1b7cd6,_0x3654c0){return new BPromise(function(_0x22e0fd,_0x5e370c){return client[_0xd134('0xa')](_0x1290f6,_0x3654c0)[_0xd134('0xb')](function(_0x146b8a){logger['info'](_0xd134('0xc'),_0x1b7cd6,_0xd134('0xd'));logger['debug'](_0xd134('0xe'),_0x1b7cd6,'request\x20sent',JSON[_0xd134('0xf')](_0x146b8a));if(_0x146b8a[_0xd134('0x10')]){if(_0x146b8a[_0xd134('0x10')][_0xd134('0x11')]===0x1f4){logger[_0xd134('0x10')](_0xd134('0xc'),_0x1b7cd6,_0x146b8a['error']['message']);return _0x5e370c(_0x146b8a[_0xd134('0x10')][_0xd134('0x12')]);}logger[_0xd134('0x10')](_0xd134('0xc'),_0x1b7cd6,_0x146b8a[_0xd134('0x10')][_0xd134('0x12')]);return _0x22e0fd(_0x146b8a[_0xd134('0x10')][_0xd134('0x12')]);}else{logger['info'](_0xd134('0xc'),_0x1b7cd6,'request\x20sent');_0x22e0fd(_0x146b8a[_0xd134('0x13')][_0xd134('0x12')]);}})[_0xd134('0x14')](function(_0x11bb28){logger[_0xd134('0x10')](_0xd134('0xc'),_0x1b7cd6,_0x11bb28);_0x5e370c(_0x11bb28);});});}