Built motion from commit (unavailable).|2.6.0
[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 _0x1c09=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4df4c4,_0x13a087){var _0x23bc7=function(_0x54d049){while(--_0x54d049){_0x4df4c4['push'](_0x4df4c4['shift']());}};_0x23bc7(++_0x13a087);}(_0x1c09,0x178));var _0x91c0=function(_0xf38456,_0x5ebc38){_0xf38456=_0xf38456-0x0;var _0x4cab13=_0x1c09[_0xf38456];return _0x4cab13;};'use strict';var _=require(_0x91c0('0x0'));var util=require(_0x91c0('0x1'));var moment=require(_0x91c0('0x2'));var BPromise=require(_0x91c0('0x3'));var rs=require(_0x91c0('0x4'));var fs=require('fs');var Redis=require(_0x91c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x91c0('0x6'));var logger=require(_0x91c0('0x7'))(_0x91c0('0x8'));var config=require(_0x91c0('0x9'));var jayson=require(_0x91c0('0xa'));var client=jayson['client'][_0x91c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x112d41,_0x4a2121,_0x218af8){return new BPromise(function(_0x1cacd4,_0x457b54){return client[_0x91c0('0xc')](_0x112d41,_0x218af8)[_0x91c0('0xd')](function(_0x12a4b2){logger['info'](_0x91c0('0xe'),_0x4a2121,_0x91c0('0xf'));logger['debug'](_0x91c0('0x10'),_0x4a2121,_0x91c0('0xf'),JSON[_0x91c0('0x11')](_0x12a4b2));if(_0x12a4b2[_0x91c0('0x12')]){if(_0x12a4b2['error'][_0x91c0('0x13')]===0x1f4){logger[_0x91c0('0x12')](_0x91c0('0xe'),_0x4a2121,_0x12a4b2[_0x91c0('0x12')][_0x91c0('0x14')]);return _0x457b54(_0x12a4b2['error'][_0x91c0('0x14')]);}logger[_0x91c0('0x12')](_0x91c0('0xe'),_0x4a2121,_0x12a4b2[_0x91c0('0x12')][_0x91c0('0x14')]);return _0x1cacd4(_0x12a4b2['error'][_0x91c0('0x14')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x4a2121,_0x91c0('0xf'));_0x1cacd4(_0x12a4b2[_0x91c0('0x15')][_0x91c0('0x14')]);}})['catch'](function(_0x269652){logger[_0x91c0('0x12')](_0x91c0('0xe'),_0x4a2121,_0x269652);_0x457b54(_0x269652);});});}