Built motion from commit (unavailable).|2.5.17
[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 _0x6039=['ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent'];(function(_0x4e3003,_0x1ae292){var _0x5c046d=function(_0x2b8f39){while(--_0x2b8f39){_0x4e3003['push'](_0x4e3003['shift']());}};_0x5c046d(++_0x1ae292);}(_0x6039,0x15f));var _0x9603=function(_0x14d113,_0x5aabda){_0x14d113=_0x14d113-0x0;var _0x25316d=_0x6039[_0x14d113];return _0x25316d;};'use strict';var _=require(_0x9603('0x0'));var util=require(_0x9603('0x1'));var moment=require(_0x9603('0x2'));var BPromise=require(_0x9603('0x3'));var rs=require(_0x9603('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9603('0x5'))['db'];var utils=require(_0x9603('0x6'));var logger=require(_0x9603('0x7'))(_0x9603('0x8'));var config=require(_0x9603('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9603('0xa')][_0x9603('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x182545,_0x5cc6cb,_0x507d3a){return new BPromise(function(_0x128b98,_0x59ca8d){return client[_0x9603('0xc')](_0x182545,_0x507d3a)[_0x9603('0xd')](function(_0x14464a){logger[_0x9603('0xe')](_0x9603('0xf'),_0x5cc6cb,_0x9603('0x10'));logger['debug'](_0x9603('0x11'),_0x5cc6cb,_0x9603('0x10'),JSON[_0x9603('0x12')](_0x14464a));if(_0x14464a['error']){if(_0x14464a[_0x9603('0x13')]['code']===0x1f4){logger['error'](_0x9603('0xf'),_0x5cc6cb,_0x14464a['error']['message']);return _0x59ca8d(_0x14464a['error'][_0x9603('0x14')]);}logger[_0x9603('0x13')](_0x9603('0xf'),_0x5cc6cb,_0x14464a[_0x9603('0x13')][_0x9603('0x14')]);return _0x128b98(_0x14464a['error'][_0x9603('0x14')]);}else{logger[_0x9603('0xe')](_0x9603('0xf'),_0x5cc6cb,_0x9603('0x10'));_0x128b98(_0x14464a[_0x9603('0x15')][_0x9603('0x14')]);}})[_0x9603('0x16')](function(_0x17b24d){logger[_0x9603('0x13')](_0x9603('0xf'),_0x5cc6cb,_0x17b24d);_0x59ca8d(_0x17b24d);});});}