Built motion from commit 5293bb2a.|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 _0x4ec9=['info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then'];(function(_0x327e4a,_0x1f8163){var _0x43fe89=function(_0x27a01a){while(--_0x27a01a){_0x327e4a['push'](_0x327e4a['shift']());}};_0x43fe89(++_0x1f8163);}(_0x4ec9,0x184));var _0x94ec=function(_0x5b1042,_0x21f757){_0x5b1042=_0x5b1042-0x0;var _0x28485d=_0x4ec9[_0x5b1042];return _0x28485d;};'use strict';var _=require(_0x94ec('0x0'));var util=require(_0x94ec('0x1'));var moment=require('moment');var BPromise=require(_0x94ec('0x2'));var rs=require(_0x94ec('0x3'));var fs=require('fs');var Redis=require(_0x94ec('0x4'));var db=require(_0x94ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x94ec('0x6'))('rpc');var config=require(_0x94ec('0x7'));var jayson=require(_0x94ec('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x149d85,_0x5b1c46,_0x1da9d5){return new BPromise(function(_0xcc0de4,_0x4bbcf9){return client[_0x94ec('0x9')](_0x149d85,_0x1da9d5)[_0x94ec('0xa')](function(_0x1772ed){logger[_0x94ec('0xb')](_0x94ec('0xc'),_0x5b1c46,'request\x20sent');logger[_0x94ec('0xd')](_0x94ec('0xe'),_0x5b1c46,_0x94ec('0xf'),JSON[_0x94ec('0x10')](_0x1772ed));if(_0x1772ed['error']){if(_0x1772ed[_0x94ec('0x11')]['code']===0x1f4){logger[_0x94ec('0x11')](_0x94ec('0xc'),_0x5b1c46,_0x1772ed[_0x94ec('0x11')][_0x94ec('0x12')]);return _0x4bbcf9(_0x1772ed[_0x94ec('0x11')]['message']);}logger[_0x94ec('0x11')](_0x94ec('0xc'),_0x5b1c46,_0x1772ed[_0x94ec('0x11')][_0x94ec('0x12')]);return _0xcc0de4(_0x1772ed[_0x94ec('0x11')][_0x94ec('0x12')]);}else{logger[_0x94ec('0xb')](_0x94ec('0xc'),_0x5b1c46,_0x94ec('0xf'));_0xcc0de4(_0x1772ed[_0x94ec('0x13')]['message']);}})[_0x94ec('0x14')](function(_0x1869d7){logger[_0x94ec('0x11')](_0x94ec('0xc'),_0x5b1c46,_0x1869d7);_0x4bbcf9(_0x1869d7);});});}