Built motion from commit 994c64e1.|2.6.1
[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 _0xe542=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xe542,0x16e));var _0x2e54=function(_0x1b7097,_0x55bf9d){_0x1b7097=_0x1b7097-0x0;var _0x11c757=_0xe542[_0x1b7097];return _0x11c757;};'use strict';var _=require(_0x2e54('0x0'));var util=require(_0x2e54('0x1'));var moment=require(_0x2e54('0x2'));var BPromise=require(_0x2e54('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e54('0x4'))(_0x2e54('0x5'));var config=require(_0x2e54('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e54('0x7')][_0x2e54('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d2990,_0x1ce52a,_0x271493){return new BPromise(function(_0x24e3ce,_0x1a337b){return client[_0x2e54('0x9')](_0x5d2990,_0x271493)[_0x2e54('0xa')](function(_0x6fe969){logger[_0x2e54('0xb')](_0x2e54('0xc'),_0x1ce52a,_0x2e54('0xd'));logger['debug'](_0x2e54('0xe'),_0x1ce52a,_0x2e54('0xd'),JSON[_0x2e54('0xf')](_0x6fe969));if(_0x6fe969[_0x2e54('0x10')]){if(_0x6fe969[_0x2e54('0x10')][_0x2e54('0x11')]===0x1f4){logger[_0x2e54('0x10')](_0x2e54('0xc'),_0x1ce52a,_0x6fe969[_0x2e54('0x10')]['message']);return _0x1a337b(_0x6fe969[_0x2e54('0x10')][_0x2e54('0x12')]);}logger[_0x2e54('0x10')](_0x2e54('0xc'),_0x1ce52a,_0x6fe969[_0x2e54('0x10')][_0x2e54('0x12')]);return _0x24e3ce(_0x6fe969[_0x2e54('0x10')][_0x2e54('0x12')]);}else{logger[_0x2e54('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1ce52a,_0x2e54('0xd'));_0x24e3ce(_0x6fe969[_0x2e54('0x13')][_0x2e54('0x12')]);}})[_0x2e54('0x14')](function(_0x4f5528){logger['error'](_0x2e54('0xc'),_0x1ce52a,_0x4f5528);_0x1a337b(_0x4f5528);});});}