Built motion from commit 55091a5c.|2.6.30
[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 _0xa5e6=['http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2300fa,_0x41c382){var _0x11fef0=function(_0x597ffb){while(--_0x597ffb){_0x2300fa['push'](_0x2300fa['shift']());}};_0x11fef0(++_0x41c382);}(_0xa5e6,0x15d));var _0x6a5e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa5e6[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x6a5e('0x0'));var moment=require(_0x6a5e('0x1'));var BPromise=require(_0x6a5e('0x2'));var rs=require(_0x6a5e('0x3'));var fs=require('fs');var Redis=require(_0x6a5e('0x4'));var db=require(_0x6a5e('0x5'))['db'];var utils=require(_0x6a5e('0x6'));var logger=require(_0x6a5e('0x7'))(_0x6a5e('0x8'));var config=require(_0x6a5e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6a5e('0xa')][_0x6a5e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51790e,_0x39510e,_0x2524d4){return new BPromise(function(_0x44c1d1,_0x38271e){return client[_0x6a5e('0xc')](_0x51790e,_0x2524d4)[_0x6a5e('0xd')](function(_0x170b82){logger[_0x6a5e('0xe')](_0x6a5e('0xf'),_0x39510e,_0x6a5e('0x10'));logger[_0x6a5e('0x11')](_0x6a5e('0x12'),_0x39510e,_0x6a5e('0x10'),JSON['stringify'](_0x170b82));if(_0x170b82[_0x6a5e('0x13')]){if(_0x170b82[_0x6a5e('0x13')][_0x6a5e('0x14')]===0x1f4){logger[_0x6a5e('0x13')](_0x6a5e('0xf'),_0x39510e,_0x170b82[_0x6a5e('0x13')][_0x6a5e('0x15')]);return _0x38271e(_0x170b82[_0x6a5e('0x13')][_0x6a5e('0x15')]);}logger[_0x6a5e('0x13')](_0x6a5e('0xf'),_0x39510e,_0x170b82['error'][_0x6a5e('0x15')]);return _0x44c1d1(_0x170b82[_0x6a5e('0x13')][_0x6a5e('0x15')]);}else{logger[_0x6a5e('0xe')](_0x6a5e('0xf'),_0x39510e,'request\x20sent');_0x44c1d1(_0x170b82[_0x6a5e('0x16')]['message']);}})[_0x6a5e('0x17')](function(_0x5e1ad5){logger['error']('ZendeskField,\x20%s,\x20%s',_0x39510e,_0x5e1ad5);_0x38271e(_0x5e1ad5);});});}