Built motion from commit c738b9ac.|2.6.25
[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 _0x444a=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x444a,0xd9));var _0xa444=function(_0x2dce9f,_0x1d1880){_0x2dce9f=_0x2dce9f-0x0;var _0x1cd454=_0x444a[_0x2dce9f];return _0x1cd454;};'use strict';var _=require(_0xa444('0x0'));var util=require('util');var moment=require(_0xa444('0x1'));var BPromise=require(_0xa444('0x2'));var rs=require(_0xa444('0x3'));var fs=require('fs');var Redis=require(_0xa444('0x4'));var db=require(_0xa444('0x5'))['db'];var utils=require(_0xa444('0x6'));var logger=require(_0xa444('0x7'))('rpc');var config=require(_0xa444('0x8'));var jayson=require(_0xa444('0x9'));var client=jayson['client'][_0xa444('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58891d,_0x5b0521,_0x164746){return new BPromise(function(_0x293b35,_0x1c8b0f){return client[_0xa444('0xb')](_0x58891d,_0x164746)[_0xa444('0xc')](function(_0x19be4a){logger[_0xa444('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5b0521,'request\x20sent');logger[_0xa444('0xe')](_0xa444('0xf'),_0x5b0521,'request\x20sent',JSON[_0xa444('0x10')](_0x19be4a));if(_0x19be4a[_0xa444('0x11')]){if(_0x19be4a['error'][_0xa444('0x12')]===0x1f4){logger['error'](_0xa444('0x13'),_0x5b0521,_0x19be4a[_0xa444('0x11')]['message']);return _0x1c8b0f(_0x19be4a[_0xa444('0x11')]['message']);}logger[_0xa444('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5b0521,_0x19be4a[_0xa444('0x11')][_0xa444('0x14')]);return _0x293b35(_0x19be4a[_0xa444('0x11')]['message']);}else{logger['info'](_0xa444('0x13'),_0x5b0521,_0xa444('0x15'));_0x293b35(_0x19be4a[_0xa444('0x16')][_0xa444('0x14')]);}})[_0xa444('0x17')](function(_0x3d6e79){logger['error'](_0xa444('0x13'),_0x5b0521,_0x3d6e79);_0x1c8b0f(_0x3d6e79);});});}