edd4d55c8344fff9649feaed1d7d88d65e1f0ed9
[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 _0x491d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0x491d,0xa9));var _0xd491=function(_0x43b086,_0x196431){_0x43b086=_0x43b086-0x0;var _0x42d1f7=_0x491d[_0x43b086];return _0x42d1f7;};'use strict';var _=require(_0xd491('0x0'));var util=require(_0xd491('0x1'));var moment=require(_0xd491('0x2'));var BPromise=require(_0xd491('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd491('0x4'));var db=require(_0xd491('0x5'))['db'];var utils=require(_0xd491('0x6'));var logger=require('../../config/logger')(_0xd491('0x7'));var config=require(_0xd491('0x8'));var jayson=require(_0xd491('0x9'));var client=jayson[_0xd491('0xa')][_0xd491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x830302,_0x49a440,_0x2182fb){return new BPromise(function(_0x3319f2,_0xe2cb34){return client[_0xd491('0xc')](_0x830302,_0x2182fb)[_0xd491('0xd')](function(_0xb09b25){logger[_0xd491('0xe')](_0xd491('0xf'),_0x49a440,_0xd491('0x10'));logger[_0xd491('0x11')](_0xd491('0x12'),_0x49a440,_0xd491('0x10'),JSON[_0xd491('0x13')](_0xb09b25));if(_0xb09b25[_0xd491('0x14')]){if(_0xb09b25['error'][_0xd491('0x15')]===0x1f4){logger[_0xd491('0x14')](_0xd491('0xf'),_0x49a440,_0xb09b25['error'][_0xd491('0x16')]);return _0xe2cb34(_0xb09b25[_0xd491('0x14')][_0xd491('0x16')]);}logger[_0xd491('0x14')](_0xd491('0xf'),_0x49a440,_0xb09b25['error'][_0xd491('0x16')]);return _0x3319f2(_0xb09b25['error'][_0xd491('0x16')]);}else{logger['info'](_0xd491('0xf'),_0x49a440,_0xd491('0x10'));_0x3319f2(_0xb09b25[_0xd491('0x17')][_0xd491('0x16')]);}})[_0xd491('0x18')](function(_0x373849){logger[_0xd491('0x14')](_0xd491('0xf'),_0x49a440,_0x373849);_0xe2cb34(_0x373849);});});}