7745c18997ab13ba0b8f003ac3d7e5cb6c97ee8b
[motion2.git] / server / api / intServicenowField / intServicenowField.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 _0xfd07=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfd07,0x165));var _0x7fd0=function(_0x155af3,_0x4b7f9a){_0x155af3=_0x155af3-0x0;var _0x15a675=_0xfd07[_0x155af3];return _0x15a675;};'use strict';var _=require(_0x7fd0('0x0'));var util=require(_0x7fd0('0x1'));var moment=require(_0x7fd0('0x2'));var BPromise=require(_0x7fd0('0x3'));var rs=require(_0x7fd0('0x4'));var fs=require('fs');var Redis=require(_0x7fd0('0x5'));var db=require(_0x7fd0('0x6'))['db'];var utils=require(_0x7fd0('0x7'));var logger=require(_0x7fd0('0x8'))('rpc');var config=require(_0x7fd0('0x9'));var jayson=require(_0x7fd0('0xa'));var client=jayson[_0x7fd0('0xb')][_0x7fd0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f7f67,_0x28af68,_0x326dc7){return new BPromise(function(_0x366502,_0x43b8a1){return client[_0x7fd0('0xd')](_0x3f7f67,_0x326dc7)[_0x7fd0('0xe')](function(_0xdf60d5){logger['info'](_0x7fd0('0xf'),_0x28af68,_0x7fd0('0x10'));logger[_0x7fd0('0x11')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x28af68,'request\x20sent',JSON[_0x7fd0('0x12')](_0xdf60d5));if(_0xdf60d5[_0x7fd0('0x13')]){if(_0xdf60d5[_0x7fd0('0x13')][_0x7fd0('0x14')]===0x1f4){logger[_0x7fd0('0x13')](_0x7fd0('0xf'),_0x28af68,_0xdf60d5[_0x7fd0('0x13')][_0x7fd0('0x15')]);return _0x43b8a1(_0xdf60d5[_0x7fd0('0x13')][_0x7fd0('0x15')]);}logger[_0x7fd0('0x13')](_0x7fd0('0xf'),_0x28af68,_0xdf60d5[_0x7fd0('0x13')][_0x7fd0('0x15')]);return _0x366502(_0xdf60d5[_0x7fd0('0x13')][_0x7fd0('0x15')]);}else{logger[_0x7fd0('0x16')](_0x7fd0('0xf'),_0x28af68,_0x7fd0('0x10'));_0x366502(_0xdf60d5['result']['message']);}})[_0x7fd0('0x17')](function(_0x3e987d){logger[_0x7fd0('0x13')]('ServicenowField,\x20%s,\x20%s',_0x28af68,_0x3e987d);_0x43b8a1(_0x3e987d);});});}