Built motion from commit (unavailable).|2.5.16
[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 _0xd1f2=['request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug'];(function(_0x2a588a,_0x432cb9){var _0x2da7f3=function(_0x1c1583){while(--_0x1c1583){_0x2a588a['push'](_0x2a588a['shift']());}};_0x2da7f3(++_0x432cb9);}(_0xd1f2,0x127));var _0x2d1f=function(_0x47cb3d,_0x151bcb){_0x47cb3d=_0x47cb3d-0x0;var _0x1bf2ff=_0xd1f2[_0x47cb3d];return _0x1bf2ff;};'use strict';var _=require(_0x2d1f('0x0'));var util=require(_0x2d1f('0x1'));var moment=require(_0x2d1f('0x2'));var BPromise=require(_0x2d1f('0x3'));var rs=require(_0x2d1f('0x4'));var fs=require('fs');var Redis=require(_0x2d1f('0x5'));var db=require(_0x2d1f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d1f('0x7'));var config=require(_0x2d1f('0x8'));var jayson=require(_0x2d1f('0x9'));var client=jayson[_0x2d1f('0xa')][_0x2d1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf13aed,_0x1a9e42,_0x68671f){return new BPromise(function(_0x2d17a8,_0x40e1c3){return client[_0x2d1f('0xc')](_0xf13aed,_0x68671f)[_0x2d1f('0xd')](function(_0x499d6d){logger[_0x2d1f('0xe')](_0x2d1f('0xf'),_0x1a9e42,'request\x20sent');logger[_0x2d1f('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1a9e42,_0x2d1f('0x11'),JSON[_0x2d1f('0x12')](_0x499d6d));if(_0x499d6d['error']){if(_0x499d6d['error'][_0x2d1f('0x13')]===0x1f4){logger[_0x2d1f('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a9e42,_0x499d6d[_0x2d1f('0x14')][_0x2d1f('0x15')]);return _0x40e1c3(_0x499d6d[_0x2d1f('0x14')][_0x2d1f('0x15')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x1a9e42,_0x499d6d[_0x2d1f('0x14')][_0x2d1f('0x15')]);return _0x2d17a8(_0x499d6d['error'][_0x2d1f('0x15')]);}else{logger[_0x2d1f('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a9e42,_0x2d1f('0x11'));_0x2d17a8(_0x499d6d[_0x2d1f('0x16')][_0x2d1f('0x15')]);}})[_0x2d1f('0x17')](function(_0x2cd0b1){logger[_0x2d1f('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a9e42,_0x2cd0b1);_0x40e1c3(_0x2cd0b1);});});}