Built motion from commit (unavailable).|2.5.31
[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 _0xc02b=['client','http','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x255e15,_0x22702b){var _0x27d27e=function(_0xfff767){while(--_0xfff767){_0x255e15['push'](_0x255e15['shift']());}};_0x27d27e(++_0x22702b);}(_0xc02b,0x16d));var _0xbc02=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xc02b[_0x4a9beb];return _0x2d4c58;};'use strict';var _=require(_0xbc02('0x0'));var util=require(_0xbc02('0x1'));var moment=require(_0xbc02('0x2'));var BPromise=require(_0xbc02('0x3'));var rs=require(_0xbc02('0x4'));var fs=require('fs');var Redis=require(_0xbc02('0x5'));var db=require(_0xbc02('0x6'))['db'];var utils=require(_0xbc02('0x7'));var logger=require(_0xbc02('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc02('0x9')][_0xbc02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bcc09,_0x2ad7b9,_0x5a8b5a){return new BPromise(function(_0x73cba5,_0x986288){return client[_0xbc02('0xb')](_0x4bcc09,_0x5a8b5a)[_0xbc02('0xc')](function(_0x449bc5){logger['info'](_0xbc02('0xd'),_0x2ad7b9,_0xbc02('0xe'));logger['debug']('ServicenowField,\x20%s,\x20%s,\x20%s',_0x2ad7b9,_0xbc02('0xe'),JSON[_0xbc02('0xf')](_0x449bc5));if(_0x449bc5[_0xbc02('0x10')]){if(_0x449bc5[_0xbc02('0x10')][_0xbc02('0x11')]===0x1f4){logger[_0xbc02('0x10')](_0xbc02('0xd'),_0x2ad7b9,_0x449bc5[_0xbc02('0x10')][_0xbc02('0x12')]);return _0x986288(_0x449bc5[_0xbc02('0x10')][_0xbc02('0x12')]);}logger[_0xbc02('0x10')](_0xbc02('0xd'),_0x2ad7b9,_0x449bc5[_0xbc02('0x10')][_0xbc02('0x12')]);return _0x73cba5(_0x449bc5['error']['message']);}else{logger[_0xbc02('0x13')](_0xbc02('0xd'),_0x2ad7b9,_0xbc02('0xe'));_0x73cba5(_0x449bc5[_0xbc02('0x14')][_0xbc02('0x12')]);}})[_0xbc02('0x15')](function(_0x439875){logger[_0xbc02('0x10')](_0xbc02('0xd'),_0x2ad7b9,_0x439875);_0x986288(_0x439875);});});}