addbc7d001c0bae5c0744c2279fe7c2cd10ea245
[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 _0x7370=['error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xc3e0f0,_0x2fb885){var _0xdb8147=function(_0x2f9dc6){while(--_0x2f9dc6){_0xc3e0f0['push'](_0xc3e0f0['shift']());}};_0xdb8147(++_0x2fb885);}(_0x7370,0x1e2));var _0x0737=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x7370[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x0737('0x0'));var util=require(_0x0737('0x1'));var moment=require(_0x0737('0x2'));var BPromise=require(_0x0737('0x3'));var rs=require(_0x0737('0x4'));var fs=require('fs');var Redis=require(_0x0737('0x5'));var db=require(_0x0737('0x6'))['db'];var utils=require(_0x0737('0x7'));var logger=require(_0x0737('0x8'))(_0x0737('0x9'));var config=require(_0x0737('0xa'));var jayson=require(_0x0737('0xb'));var client=jayson['client'][_0x0737('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb44b81,_0x3e424a,_0x11f6c8){return new BPromise(function(_0x57909f,_0x61bc0e){return client[_0x0737('0xd')](_0xb44b81,_0x11f6c8)[_0x0737('0xe')](function(_0xd89bb2){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x3e424a,'request\x20sent');logger['debug'](_0x0737('0xf'),_0x3e424a,_0x0737('0x10'),JSON[_0x0737('0x11')](_0xd89bb2));if(_0xd89bb2[_0x0737('0x12')]){if(_0xd89bb2[_0x0737('0x12')][_0x0737('0x13')]===0x1f4){logger[_0x0737('0x12')](_0x0737('0x14'),_0x3e424a,_0xd89bb2['error']['message']);return _0x61bc0e(_0xd89bb2[_0x0737('0x12')][_0x0737('0x15')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3e424a,_0xd89bb2[_0x0737('0x12')][_0x0737('0x15')]);return _0x57909f(_0xd89bb2[_0x0737('0x12')][_0x0737('0x15')]);}else{logger[_0x0737('0x16')](_0x0737('0x14'),_0x3e424a,_0x0737('0x10'));_0x57909f(_0xd89bb2[_0x0737('0x17')][_0x0737('0x15')]);}})[_0x0737('0x18')](function(_0x5c6f9f){logger[_0x0737('0x12')](_0x0737('0x14'),_0x3e424a,_0x5c6f9f);_0x61bc0e(_0x5c6f9f);});});}