65574405ad8beff946fcc6390b70bc8e5ac32fee
[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 _0x89df=['catch','lodash','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x89df,0xf1));var _0xf89d=function(_0xf34d02,_0x284548){_0xf34d02=_0xf34d02-0x0;var _0x9182d=_0x89df[_0xf34d02];return _0x9182d;};'use strict';var _=require(_0xf89d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf89d('0x1'));var fs=require('fs');var Redis=require(_0xf89d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf89d('0x3'))(_0xf89d('0x4'));var config=require('../../config/environment');var jayson=require(_0xf89d('0x5'));var client=jayson[_0xf89d('0x6')][_0xf89d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50a8ba,_0x2e9481,_0x26023d){return new BPromise(function(_0x4b7b45,_0x2c951a){return client[_0xf89d('0x8')](_0x50a8ba,_0x26023d)[_0xf89d('0x9')](function(_0x558548){logger['info'](_0xf89d('0xa'),_0x2e9481,_0xf89d('0xb'));logger[_0xf89d('0xc')](_0xf89d('0xd'),_0x2e9481,_0xf89d('0xb'),JSON[_0xf89d('0xe')](_0x558548));if(_0x558548[_0xf89d('0xf')]){if(_0x558548[_0xf89d('0xf')][_0xf89d('0x10')]===0x1f4){logger[_0xf89d('0xf')](_0xf89d('0xa'),_0x2e9481,_0x558548[_0xf89d('0xf')][_0xf89d('0x11')]);return _0x2c951a(_0x558548['error'][_0xf89d('0x11')]);}logger['error'](_0xf89d('0xa'),_0x2e9481,_0x558548[_0xf89d('0xf')]['message']);return _0x4b7b45(_0x558548['error'][_0xf89d('0x11')]);}else{logger[_0xf89d('0x12')](_0xf89d('0xa'),_0x2e9481,_0xf89d('0xb'));_0x4b7b45(_0x558548['result'][_0xf89d('0x11')]);}})[_0xf89d('0x13')](function(_0x313e43){logger[_0xf89d('0xf')](_0xf89d('0xa'),_0x2e9481,_0x313e43);_0x2c951a(_0x313e43);});});}