Built motion from commit (unavailable).|2.5.16
[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 _0x3641=['ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x493d7a,_0x25587d){var _0x8e5c09=function(_0x376eaa){while(--_0x376eaa){_0x493d7a['push'](_0x493d7a['shift']());}};_0x8e5c09(++_0x25587d);}(_0x3641,0x181));var _0x1364=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3641[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1364('0x0'));var util=require('util');var moment=require(_0x1364('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1364('0x2'));var db=require(_0x1364('0x3'))['db'];var utils=require(_0x1364('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x1364('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1364('0x6')][_0x1364('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9c5200,_0xde8e9f,_0x2ec426){return new BPromise(function(_0x5b8111,_0x2b37c0){return client[_0x1364('0x8')](_0x9c5200,_0x2ec426)[_0x1364('0x9')](function(_0x27072c){logger[_0x1364('0xa')](_0x1364('0xb'),_0xde8e9f,_0x1364('0xc'));logger[_0x1364('0xd')](_0x1364('0xe'),_0xde8e9f,_0x1364('0xc'),JSON[_0x1364('0xf')](_0x27072c));if(_0x27072c[_0x1364('0x10')]){if(_0x27072c[_0x1364('0x10')][_0x1364('0x11')]===0x1f4){logger[_0x1364('0x10')](_0x1364('0xb'),_0xde8e9f,_0x27072c[_0x1364('0x10')][_0x1364('0x12')]);return _0x2b37c0(_0x27072c[_0x1364('0x10')][_0x1364('0x12')]);}logger[_0x1364('0x10')](_0x1364('0xb'),_0xde8e9f,_0x27072c[_0x1364('0x10')][_0x1364('0x12')]);return _0x5b8111(_0x27072c[_0x1364('0x10')][_0x1364('0x12')]);}else{logger[_0x1364('0xa')](_0x1364('0xb'),_0xde8e9f,_0x1364('0xc'));_0x5b8111(_0x27072c['result'][_0x1364('0x12')]);}})['catch'](function(_0x1ee8aa){logger[_0x1364('0x10')](_0x1364('0xb'),_0xde8e9f,_0x1ee8aa);_0x2b37c0(_0x1ee8aa);});});}