b455366798c63389b3cc10ac1d437d79d82410c1
[motion2.git] / server / api / intServicenowField / intServicenowField.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 _0x68cf=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x208897,_0x1cfafc){var _0x1fed9e=function(_0x180576){while(--_0x180576){_0x208897['push'](_0x208897['shift']());}};_0x1fed9e(++_0x1cfafc);}(_0x68cf,0xbf));var _0xf68c=function(_0x45871c,_0x2c2872){_0x45871c=_0x45871c-0x0;var _0x5c6a9c=_0x68cf[_0x45871c];return _0x5c6a9c;};'use strict';var _=require(_0xf68c('0x0'));var util=require(_0xf68c('0x1'));var moment=require(_0xf68c('0x2'));var BPromise=require(_0xf68c('0x3'));var rs=require(_0xf68c('0x4'));var fs=require('fs');var Redis=require(_0xf68c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf68c('0x6'));var logger=require(_0xf68c('0x7'))(_0xf68c('0x8'));var config=require('../../config/environment');var jayson=require(_0xf68c('0x9'));var client=jayson[_0xf68c('0xa')][_0xf68c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a29c4,_0x4a9b64,_0xd61be6){return new BPromise(function(_0x37f378,_0x2047d4){return client[_0xf68c('0xc')](_0x2a29c4,_0xd61be6)['then'](function(_0x3a7284){logger[_0xf68c('0xd')](_0xf68c('0xe'),_0x4a9b64,_0xf68c('0xf'));logger[_0xf68c('0x10')](_0xf68c('0x11'),_0x4a9b64,'request\x20sent',JSON[_0xf68c('0x12')](_0x3a7284));if(_0x3a7284[_0xf68c('0x13')]){if(_0x3a7284[_0xf68c('0x13')][_0xf68c('0x14')]===0x1f4){logger[_0xf68c('0x13')](_0xf68c('0xe'),_0x4a9b64,_0x3a7284['error'][_0xf68c('0x15')]);return _0x2047d4(_0x3a7284[_0xf68c('0x13')][_0xf68c('0x15')]);}logger[_0xf68c('0x13')]('ServicenowField,\x20%s,\x20%s',_0x4a9b64,_0x3a7284[_0xf68c('0x13')]['message']);return _0x37f378(_0x3a7284[_0xf68c('0x13')][_0xf68c('0x15')]);}else{logger[_0xf68c('0xd')](_0xf68c('0xe'),_0x4a9b64,_0xf68c('0xf'));_0x37f378(_0x3a7284[_0xf68c('0x16')]['message']);}})[_0xf68c('0x17')](function(_0x5765fa){logger[_0xf68c('0x13')](_0xf68c('0xe'),_0x4a9b64,_0x5765fa);_0x2047d4(_0x5765fa);});});}