Built motion from commit (unavailable).|2.5.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 _0x6517=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x8b1b8c,_0x598fa0){var _0x324ec3=function(_0x2bdcfe){while(--_0x2bdcfe){_0x8b1b8c['push'](_0x8b1b8c['shift']());}};_0x324ec3(++_0x598fa0);}(_0x6517,0x178));var _0x7651=function(_0x19b289,_0x2c8fbe){_0x19b289=_0x19b289-0x0;var _0x5da966=_0x6517[_0x19b289];return _0x5da966;};'use strict';var _=require(_0x7651('0x0'));var util=require('util');var moment=require(_0x7651('0x1'));var BPromise=require(_0x7651('0x2'));var rs=require(_0x7651('0x3'));var fs=require('fs');var Redis=require(_0x7651('0x4'));var db=require(_0x7651('0x5'))['db'];var utils=require(_0x7651('0x6'));var logger=require(_0x7651('0x7'))(_0x7651('0x8'));var config=require(_0x7651('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7651('0xa')][_0x7651('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d6b28,_0x3cadb8,_0x39eb78){return new BPromise(function(_0x2c277a,_0x1f19d1){return client[_0x7651('0xc')](_0x1d6b28,_0x39eb78)[_0x7651('0xd')](function(_0xa34ca){logger[_0x7651('0xe')](_0x7651('0xf'),_0x3cadb8,'request\x20sent');logger[_0x7651('0x10')](_0x7651('0x11'),_0x3cadb8,_0x7651('0x12'),JSON[_0x7651('0x13')](_0xa34ca));if(_0xa34ca[_0x7651('0x14')]){if(_0xa34ca[_0x7651('0x14')][_0x7651('0x15')]===0x1f4){logger[_0x7651('0x14')](_0x7651('0xf'),_0x3cadb8,_0xa34ca[_0x7651('0x14')][_0x7651('0x16')]);return _0x1f19d1(_0xa34ca[_0x7651('0x14')][_0x7651('0x16')]);}logger[_0x7651('0x14')]('ServicenowField,\x20%s,\x20%s',_0x3cadb8,_0xa34ca[_0x7651('0x14')]['message']);return _0x2c277a(_0xa34ca[_0x7651('0x14')][_0x7651('0x16')]);}else{logger[_0x7651('0xe')](_0x7651('0xf'),_0x3cadb8,_0x7651('0x12'));_0x2c277a(_0xa34ca[_0x7651('0x17')][_0x7651('0x16')]);}})[_0x7651('0x18')](function(_0x21b4ab){logger['error'](_0x7651('0xf'),_0x3cadb8,_0x21b4ab);_0x1f19d1(_0x21b4ab);});});}