22ecd6a50f4e5303d4188dc03cecf192fe9a5056
[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 _0x1702=['jayson/promise','client','http','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x511a15,_0xb8b969){var _0x40003e=function(_0x2af720){while(--_0x2af720){_0x511a15['push'](_0x511a15['shift']());}};_0x40003e(++_0xb8b969);}(_0x1702,0x114));var _0x2170=function(_0xa1dc36,_0x2d235c){_0xa1dc36=_0xa1dc36-0x0;var _0x431464=_0x1702[_0xa1dc36];return _0x431464;};'use strict';var _=require(_0x2170('0x0'));var util=require(_0x2170('0x1'));var moment=require(_0x2170('0x2'));var BPromise=require(_0x2170('0x3'));var rs=require(_0x2170('0x4'));var fs=require('fs');var Redis=require(_0x2170('0x5'));var db=require(_0x2170('0x6'))['db'];var utils=require(_0x2170('0x7'));var logger=require('../../config/logger')(_0x2170('0x8'));var config=require(_0x2170('0x9'));var jayson=require(_0x2170('0xa'));var client=jayson[_0x2170('0xb')][_0x2170('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b6233,_0x4446d8,_0x34151f){return new BPromise(function(_0x2f937f,_0xe8569e){return client[_0x2170('0xd')](_0x4b6233,_0x34151f)[_0x2170('0xe')](function(_0x5ee74f){logger[_0x2170('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4446d8,'request\x20sent');logger[_0x2170('0x10')](_0x2170('0x11'),_0x4446d8,_0x2170('0x12'),JSON[_0x2170('0x13')](_0x5ee74f));if(_0x5ee74f[_0x2170('0x14')]){if(_0x5ee74f[_0x2170('0x14')][_0x2170('0x15')]===0x1f4){logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x5ee74f['error'][_0x2170('0x17')]);return _0xe8569e(_0x5ee74f[_0x2170('0x14')][_0x2170('0x17')]);}logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x5ee74f['error'][_0x2170('0x17')]);return _0x2f937f(_0x5ee74f['error'][_0x2170('0x17')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x4446d8,_0x2170('0x12'));_0x2f937f(_0x5ee74f[_0x2170('0x18')][_0x2170('0x17')]);}})[_0x2170('0x19')](function(_0x455ee2){logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x455ee2);_0xe8569e(_0x455ee2);});});}