Built motion from commit (unavailable).|2.4.7
[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 _0xb041=['rpc','../../config/environment','jayson/promise','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c77f3,_0x2ece5f){var _0x2c5022=function(_0x44f6fa){while(--_0x44f6fa){_0x4c77f3['push'](_0x4c77f3['shift']());}};_0x2c5022(++_0x2ece5f);}(_0xb041,0xea));var _0x1b04=function(_0x161361,_0x473656){_0x161361=_0x161361-0x0;var _0x384048=_0xb041[_0x161361];return _0x384048;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b04('0x0'));var BPromise=require(_0x1b04('0x1'));var rs=require(_0x1b04('0x2'));var fs=require('fs');var Redis=require(_0x1b04('0x3'));var db=require(_0x1b04('0x4'))['db'];var utils=require(_0x1b04('0x5'));var logger=require('../../config/logger')(_0x1b04('0x6'));var config=require(_0x1b04('0x7'));var jayson=require(_0x1b04('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23682d,_0x10dab0,_0x49d154){return new BPromise(function(_0x4ee704,_0x45283e){return client[_0x1b04('0x9')](_0x23682d,_0x49d154)[_0x1b04('0xa')](function(_0x327e72){logger[_0x1b04('0xb')](_0x1b04('0xc'),_0x10dab0,_0x1b04('0xd'));logger[_0x1b04('0xe')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x10dab0,'request\x20sent',JSON[_0x1b04('0xf')](_0x327e72));if(_0x327e72[_0x1b04('0x10')]){if(_0x327e72['error'][_0x1b04('0x11')]===0x1f4){logger[_0x1b04('0x10')](_0x1b04('0xc'),_0x10dab0,_0x327e72[_0x1b04('0x10')][_0x1b04('0x12')]);return _0x45283e(_0x327e72[_0x1b04('0x10')][_0x1b04('0x12')]);}logger[_0x1b04('0x10')]('ServicenowField,\x20%s,\x20%s',_0x10dab0,_0x327e72['error'][_0x1b04('0x12')]);return _0x4ee704(_0x327e72[_0x1b04('0x10')][_0x1b04('0x12')]);}else{logger[_0x1b04('0xb')](_0x1b04('0xc'),_0x10dab0,_0x1b04('0xd'));_0x4ee704(_0x327e72['result'][_0x1b04('0x12')]);}})[_0x1b04('0x13')](function(_0x44247e){logger['error'](_0x1b04('0xc'),_0x10dab0,_0x44247e);_0x45283e(_0x44247e);});});}