Built motion from commit (unavailable).|2.5.21
[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 _0x6cc0=['http','request','info','ServicenowField,\x20%s,\x20%s','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x40a0d6,_0x30c477){var _0x288a38=function(_0x45a888){while(--_0x45a888){_0x40a0d6['push'](_0x40a0d6['shift']());}};_0x288a38(++_0x30c477);}(_0x6cc0,0x199));var _0x06cc=function(_0x200548,_0x52603d){_0x200548=_0x200548-0x0;var _0x50970b=_0x6cc0[_0x200548];return _0x50970b;};'use strict';var _=require(_0x06cc('0x0'));var util=require('util');var moment=require(_0x06cc('0x1'));var BPromise=require(_0x06cc('0x2'));var rs=require(_0x06cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06cc('0x4'))['db'];var utils=require(_0x06cc('0x5'));var logger=require(_0x06cc('0x6'))(_0x06cc('0x7'));var config=require('../../config/environment');var jayson=require(_0x06cc('0x8'));var client=jayson['client'][_0x06cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17f3d9,_0x469a70,_0x3c987f){return new BPromise(function(_0x2e0cc0,_0x3f453e){return client[_0x06cc('0xa')](_0x17f3d9,_0x3c987f)['then'](function(_0x5e5160){logger[_0x06cc('0xb')](_0x06cc('0xc'),_0x469a70,'request\x20sent');logger['debug'](_0x06cc('0xd'),_0x469a70,_0x06cc('0xe'),JSON['stringify'](_0x5e5160));if(_0x5e5160[_0x06cc('0xf')]){if(_0x5e5160[_0x06cc('0xf')]['code']===0x1f4){logger[_0x06cc('0xf')](_0x06cc('0xc'),_0x469a70,_0x5e5160['error'][_0x06cc('0x10')]);return _0x3f453e(_0x5e5160['error'][_0x06cc('0x10')]);}logger['error'](_0x06cc('0xc'),_0x469a70,_0x5e5160[_0x06cc('0xf')][_0x06cc('0x10')]);return _0x2e0cc0(_0x5e5160[_0x06cc('0xf')][_0x06cc('0x10')]);}else{logger[_0x06cc('0xb')](_0x06cc('0xc'),_0x469a70,_0x06cc('0xe'));_0x2e0cc0(_0x5e5160[_0x06cc('0x11')]['message']);}})[_0x06cc('0x12')](function(_0x2ca21c){logger[_0x06cc('0xf')](_0x06cc('0xc'),_0x469a70,_0x2ca21c);_0x3f453e(_0x2ca21c);});});}