cdad8ec08d0fea9d75086a0fffea6429ea576e7e
[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 _0xaefa=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x35b4ed,_0x46193c){var _0x4f594a=function(_0x5e7140){while(--_0x5e7140){_0x35b4ed['push'](_0x35b4ed['shift']());}};_0x4f594a(++_0x46193c);}(_0xaefa,0xe6));var _0xaaef=function(_0x59eeac,_0x3b7109){_0x59eeac=_0x59eeac-0x0;var _0x5e11da=_0xaefa[_0x59eeac];return _0x5e11da;};'use strict';var _=require('lodash');var util=require(_0xaaef('0x0'));var moment=require(_0xaaef('0x1'));var BPromise=require(_0xaaef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaef('0x3'));var db=require(_0xaaef('0x4'))['db'];var utils=require(_0xaaef('0x5'));var logger=require(_0xaaef('0x6'))('rpc');var config=require(_0xaaef('0x7'));var jayson=require(_0xaaef('0x8'));var client=jayson[_0xaaef('0x9')][_0xaaef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26779a,_0x13ee62,_0x2282da){return new BPromise(function(_0x39e53c,_0x42e29e){return client[_0xaaef('0xb')](_0x26779a,_0x2282da)[_0xaaef('0xc')](function(_0x40cb56){logger[_0xaaef('0xd')](_0xaaef('0xe'),_0x13ee62,_0xaaef('0xf'));logger[_0xaaef('0x10')](_0xaaef('0x11'),_0x13ee62,_0xaaef('0xf'),JSON['stringify'](_0x40cb56));if(_0x40cb56[_0xaaef('0x12')]){if(_0x40cb56['error']['code']===0x1f4){logger[_0xaaef('0x12')](_0xaaef('0xe'),_0x13ee62,_0x40cb56['error'][_0xaaef('0x13')]);return _0x42e29e(_0x40cb56[_0xaaef('0x12')][_0xaaef('0x13')]);}logger[_0xaaef('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x13ee62,_0x40cb56[_0xaaef('0x12')]['message']);return _0x39e53c(_0x40cb56['error'][_0xaaef('0x13')]);}else{logger[_0xaaef('0xd')](_0xaaef('0xe'),_0x13ee62,_0xaaef('0xf'));_0x39e53c(_0x40cb56[_0xaaef('0x14')][_0xaaef('0x13')]);}})[_0xaaef('0x15')](function(_0x308d38){logger[_0xaaef('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x13ee62,_0x308d38);_0x42e29e(_0x308d38);});});}