Built motion from commit (unavailable).|2.5.27
[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 _0x90dc=['../../config/environment','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x90dc,0x188));var _0xc90d=function(_0x376125,_0x1958ac){_0x376125=_0x376125-0x0;var _0x431d34=_0x90dc[_0x376125];return _0x431d34;};'use strict';var _=require('lodash');var util=require(_0xc90d('0x0'));var moment=require(_0xc90d('0x1'));var BPromise=require(_0xc90d('0x2'));var rs=require(_0xc90d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc90d('0x4'))['db'];var utils=require(_0xc90d('0x5'));var logger=require(_0xc90d('0x6'))('rpc');var config=require(_0xc90d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc90d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12980e,_0x63ee45,_0x1d1ffc){return new BPromise(function(_0x4ac066,_0x30f29c){return client[_0xc90d('0x9')](_0x12980e,_0x1d1ffc)[_0xc90d('0xa')](function(_0x453390){logger[_0xc90d('0xb')](_0xc90d('0xc'),_0x63ee45,_0xc90d('0xd'));logger['debug'](_0xc90d('0xe'),_0x63ee45,_0xc90d('0xd'),JSON['stringify'](_0x453390));if(_0x453390['error']){if(_0x453390[_0xc90d('0xf')]['code']===0x1f4){logger[_0xc90d('0xf')](_0xc90d('0xc'),_0x63ee45,_0x453390[_0xc90d('0xf')][_0xc90d('0x10')]);return _0x30f29c(_0x453390[_0xc90d('0xf')]['message']);}logger[_0xc90d('0xf')](_0xc90d('0xc'),_0x63ee45,_0x453390[_0xc90d('0xf')][_0xc90d('0x10')]);return _0x4ac066(_0x453390['error'][_0xc90d('0x10')]);}else{logger[_0xc90d('0xb')](_0xc90d('0xc'),_0x63ee45,_0xc90d('0xd'));_0x4ac066(_0x453390[_0xc90d('0x11')][_0xc90d('0x10')]);}})[_0xc90d('0x12')](function(_0xe4a634){logger[_0xc90d('0xf')]('ServicenowField,\x20%s,\x20%s',_0x63ee45,_0xe4a634);_0x30f29c(_0xe4a634);});});}