b82fd6d1dd90bbc6a89c26d2eb6e7314eafe85a0
[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 _0x0a29=['info','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a29,0x134));var _0x90a2=function(_0x249daa,_0x2473a5){_0x249daa=_0x249daa-0x0;var _0x11a975=_0x0a29[_0x249daa];return _0x11a975;};'use strict';var _=require(_0x90a2('0x0'));var util=require(_0x90a2('0x1'));var moment=require(_0x90a2('0x2'));var BPromise=require(_0x90a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90a2('0x4'))['db'];var utils=require(_0x90a2('0x5'));var logger=require('../../config/logger')(_0x90a2('0x6'));var config=require('../../config/environment');var jayson=require(_0x90a2('0x7'));var client=jayson[_0x90a2('0x8')][_0x90a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19249d,_0x47b296,_0xdd4426){return new BPromise(function(_0x3231ca,_0x4885b6){return client[_0x90a2('0xa')](_0x19249d,_0xdd4426)[_0x90a2('0xb')](function(_0x417d7d){logger[_0x90a2('0xc')](_0x90a2('0xd'),_0x47b296,'request\x20sent');logger[_0x90a2('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x47b296,_0x90a2('0xf'),JSON['stringify'](_0x417d7d));if(_0x417d7d['error']){if(_0x417d7d[_0x90a2('0x10')][_0x90a2('0x11')]===0x1f4){logger['error'](_0x90a2('0xd'),_0x47b296,_0x417d7d[_0x90a2('0x10')][_0x90a2('0x12')]);return _0x4885b6(_0x417d7d['error'][_0x90a2('0x12')]);}logger[_0x90a2('0x10')](_0x90a2('0xd'),_0x47b296,_0x417d7d['error'][_0x90a2('0x12')]);return _0x3231ca(_0x417d7d[_0x90a2('0x10')][_0x90a2('0x12')]);}else{logger[_0x90a2('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47b296,_0x90a2('0xf'));_0x3231ca(_0x417d7d['result'][_0x90a2('0x12')]);}})[_0x90a2('0x13')](function(_0xac4c87){logger[_0x90a2('0x10')](_0x90a2('0xd'),_0x47b296,_0xac4c87);_0x4885b6(_0xac4c87);});});}