a15d5548e080109e5d7a2d23d47d4a220f77c366
[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 _0x334a=['ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x382dc4,_0x4af643){var _0x383191=function(_0x28127e){while(--_0x28127e){_0x382dc4['push'](_0x382dc4['shift']());}};_0x383191(++_0x4af643);}(_0x334a,0x75));var _0xa334=function(_0x24f51c,_0xd4c148){_0x24f51c=_0x24f51c-0x0;var _0x304a6e=_0x334a[_0x24f51c];return _0x304a6e;};'use strict';var _=require('lodash');var util=require(_0xa334('0x0'));var moment=require(_0xa334('0x1'));var BPromise=require('bluebird');var rs=require(_0xa334('0x2'));var fs=require('fs');var Redis=require(_0xa334('0x3'));var db=require(_0xa334('0x4'))['db'];var utils=require(_0xa334('0x5'));var logger=require(_0xa334('0x6'))(_0xa334('0x7'));var config=require('../../config/environment');var jayson=require(_0xa334('0x8'));var client=jayson[_0xa334('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2064ca,_0x5ec2e3,_0x5df2ca){return new BPromise(function(_0xe39a63,_0x4f1648){return client['request'](_0x2064ca,_0x5df2ca)[_0xa334('0xa')](function(_0x5e6854){logger[_0xa334('0xb')](_0xa334('0xc'),_0x5ec2e3,_0xa334('0xd'));logger[_0xa334('0xe')](_0xa334('0xf'),_0x5ec2e3,_0xa334('0xd'),JSON[_0xa334('0x10')](_0x5e6854));if(_0x5e6854[_0xa334('0x11')]){if(_0x5e6854[_0xa334('0x11')][_0xa334('0x12')]===0x1f4){logger[_0xa334('0x11')]('ZendeskField,\x20%s,\x20%s',_0x5ec2e3,_0x5e6854['error']['message']);return _0x4f1648(_0x5e6854[_0xa334('0x11')][_0xa334('0x13')]);}logger[_0xa334('0x11')](_0xa334('0xc'),_0x5ec2e3,_0x5e6854[_0xa334('0x11')][_0xa334('0x13')]);return _0xe39a63(_0x5e6854[_0xa334('0x11')]['message']);}else{logger[_0xa334('0xb')](_0xa334('0xc'),_0x5ec2e3,_0xa334('0xd'));_0xe39a63(_0x5e6854[_0xa334('0x14')]['message']);}})[_0xa334('0x15')](function(_0x5d1ee5){logger[_0xa334('0x11')](_0xa334('0xc'),_0x5ec2e3,_0x5d1ee5);_0x4f1648(_0x5d1ee5);});});}