Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / intZendeskField / intZendeskField.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 _0xb079=['jayson/promise','client','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xb079,0x64));var _0x9b07=function(_0x14ed1b,_0x206a48){_0x14ed1b=_0x14ed1b-0x0;var _0x3c3c94=_0xb079[_0x14ed1b];return _0x3c3c94;};'use strict';var _=require(_0x9b07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b07('0x1'));var rs=require(_0x9b07('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b07('0x3'))['db'];var utils=require(_0x9b07('0x4'));var logger=require(_0x9b07('0x5'))(_0x9b07('0x6'));var config=require(_0x9b07('0x7'));var jayson=require(_0x9b07('0x8'));var client=jayson[_0x9b07('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5926df,_0x42888c,_0x2f7484){return new BPromise(function(_0xc1edec,_0x1b9b12){return client[_0x9b07('0xa')](_0x5926df,_0x2f7484)['then'](function(_0x3c8f17){logger[_0x9b07('0xb')](_0x9b07('0xc'),_0x42888c,_0x9b07('0xd'));logger[_0x9b07('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x42888c,_0x9b07('0xd'),JSON['stringify'](_0x3c8f17));if(_0x3c8f17[_0x9b07('0xf')]){if(_0x3c8f17[_0x9b07('0xf')]['code']===0x1f4){logger[_0x9b07('0xf')](_0x9b07('0xc'),_0x42888c,_0x3c8f17[_0x9b07('0xf')][_0x9b07('0x10')]);return _0x1b9b12(_0x3c8f17[_0x9b07('0xf')]['message']);}logger[_0x9b07('0xf')](_0x9b07('0xc'),_0x42888c,_0x3c8f17[_0x9b07('0xf')][_0x9b07('0x10')]);return _0xc1edec(_0x3c8f17[_0x9b07('0xf')][_0x9b07('0x10')]);}else{logger[_0x9b07('0xb')](_0x9b07('0xc'),_0x42888c,_0x9b07('0xd'));_0xc1edec(_0x3c8f17[_0x9b07('0x11')][_0x9b07('0x10')]);}})['catch'](function(_0x3d8acc){logger['error']('ZendeskField,\x20%s,\x20%s',_0x42888c,_0x3d8acc);_0x1b9b12(_0x3d8acc);});});}