Built motion from commit 25580385.|2.6.2
[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 _0xe862=['client','http','request','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0xe862,0x76));var _0x2e86=function(_0x89a2cd,_0x268e9c){_0x89a2cd=_0x89a2cd-0x0;var _0x24d57d=_0xe862[_0x89a2cd];return _0x24d57d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2e86('0x0'));var BPromise=require(_0x2e86('0x1'));var rs=require(_0x2e86('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e86('0x3'))['db'];var utils=require(_0x2e86('0x4'));var logger=require(_0x2e86('0x5'))(_0x2e86('0x6'));var config=require(_0x2e86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2e86('0x8')][_0x2e86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x139bac,_0xe5d0c1,_0x55efc6){return new BPromise(function(_0x1b970b,_0xafcdca){return client[_0x2e86('0xa')](_0x139bac,_0x55efc6)['then'](function(_0x2886ed){logger[_0x2e86('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0xe5d0c1,_0x2e86('0xc'));logger['debug'](_0x2e86('0xd'),_0xe5d0c1,_0x2e86('0xc'),JSON[_0x2e86('0xe')](_0x2886ed));if(_0x2886ed['error']){if(_0x2886ed['error'][_0x2e86('0xf')]===0x1f4){logger[_0x2e86('0x10')](_0x2e86('0x11'),_0xe5d0c1,_0x2886ed[_0x2e86('0x10')][_0x2e86('0x12')]);return _0xafcdca(_0x2886ed['error'][_0x2e86('0x12')]);}logger[_0x2e86('0x10')](_0x2e86('0x11'),_0xe5d0c1,_0x2886ed[_0x2e86('0x10')][_0x2e86('0x12')]);return _0x1b970b(_0x2886ed[_0x2e86('0x10')][_0x2e86('0x12')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0xe5d0c1,_0x2e86('0xc'));_0x1b970b(_0x2886ed[_0x2e86('0x13')][_0x2e86('0x12')]);}})[_0x2e86('0x14')](function(_0x4c37f4){logger[_0x2e86('0x10')](_0x2e86('0x11'),_0xe5d0c1,_0x4c37f4);_0xafcdca(_0x4c37f4);});});}