Built motion from commit (unavailable).|2.5.2
[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 _0x67e4=['client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x123318,_0x4c4165){var _0x39df92=function(_0x386f56){while(--_0x386f56){_0x123318['push'](_0x123318['shift']());}};_0x39df92(++_0x4c4165);}(_0x67e4,0x10a));var _0x467e=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x67e4[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require(_0x467e('0x0'));var moment=require(_0x467e('0x1'));var BPromise=require(_0x467e('0x2'));var rs=require(_0x467e('0x3'));var fs=require('fs');var Redis=require(_0x467e('0x4'));var db=require(_0x467e('0x5'))['db'];var utils=require(_0x467e('0x6'));var logger=require('../../config/logger')(_0x467e('0x7'));var config=require(_0x467e('0x8'));var jayson=require(_0x467e('0x9'));var client=jayson[_0x467e('0xa')][_0x467e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x241bbe,_0x5283f0,_0x1f3da9){return new BPromise(function(_0x116a88,_0x4d31ad){return client[_0x467e('0xc')](_0x241bbe,_0x1f3da9)[_0x467e('0xd')](function(_0x46e1df){logger[_0x467e('0xe')](_0x467e('0xf'),_0x5283f0,'request\x20sent');logger[_0x467e('0x10')](_0x467e('0x11'),_0x5283f0,_0x467e('0x12'),JSON['stringify'](_0x46e1df));if(_0x46e1df['error']){if(_0x46e1df['error']['code']===0x1f4){logger[_0x467e('0x13')]('ZendeskField,\x20%s,\x20%s',_0x5283f0,_0x46e1df[_0x467e('0x13')][_0x467e('0x14')]);return _0x4d31ad(_0x46e1df[_0x467e('0x13')]['message']);}logger[_0x467e('0x13')]('ZendeskField,\x20%s,\x20%s',_0x5283f0,_0x46e1df[_0x467e('0x13')][_0x467e('0x14')]);return _0x116a88(_0x46e1df[_0x467e('0x13')][_0x467e('0x14')]);}else{logger[_0x467e('0xe')]('ZendeskField,\x20%s,\x20%s',_0x5283f0,_0x467e('0x12'));_0x116a88(_0x46e1df[_0x467e('0x15')][_0x467e('0x14')]);}})[_0x467e('0x16')](function(_0x18ebf1){logger[_0x467e('0x13')](_0x467e('0xf'),_0x5283f0,_0x18ebf1);_0x4d31ad(_0x18ebf1);});});}