Built motion from commit (unavailable).|2.5.9
[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 _0x6b95=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x592732,_0x59f572){var _0x3b1229=function(_0xc693d3){while(--_0xc693d3){_0x592732['push'](_0x592732['shift']());}};_0x3b1229(++_0x59f572);}(_0x6b95,0x17d));var _0x56b9=function(_0xb07173,_0x184b3c){_0xb07173=_0xb07173-0x0;var _0x1c05d9=_0x6b95[_0xb07173];return _0x1c05d9;};'use strict';var _=require(_0x56b9('0x0'));var util=require(_0x56b9('0x1'));var moment=require(_0x56b9('0x2'));var BPromise=require(_0x56b9('0x3'));var rs=require(_0x56b9('0x4'));var fs=require('fs');var Redis=require(_0x56b9('0x5'));var db=require(_0x56b9('0x6'))['db'];var utils=require(_0x56b9('0x7'));var logger=require(_0x56b9('0x8'))(_0x56b9('0x9'));var config=require(_0x56b9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x56b9('0xb')][_0x56b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26f399,_0x22f98a,_0x214624){return new BPromise(function(_0x5d0770,_0x25f268){return client[_0x56b9('0xd')](_0x26f399,_0x214624)['then'](function(_0xd471b0){logger[_0x56b9('0xe')](_0x56b9('0xf'),_0x22f98a,'request\x20sent');logger[_0x56b9('0x10')](_0x56b9('0x11'),_0x22f98a,_0x56b9('0x12'),JSON[_0x56b9('0x13')](_0xd471b0));if(_0xd471b0['error']){if(_0xd471b0[_0x56b9('0x14')][_0x56b9('0x15')]===0x1f4){logger['error'](_0x56b9('0xf'),_0x22f98a,_0xd471b0[_0x56b9('0x14')][_0x56b9('0x16')]);return _0x25f268(_0xd471b0[_0x56b9('0x14')][_0x56b9('0x16')]);}logger[_0x56b9('0x14')](_0x56b9('0xf'),_0x22f98a,_0xd471b0[_0x56b9('0x14')][_0x56b9('0x16')]);return _0x5d0770(_0xd471b0[_0x56b9('0x14')]['message']);}else{logger['info'](_0x56b9('0xf'),_0x22f98a,_0x56b9('0x12'));_0x5d0770(_0xd471b0['result']['message']);}})[_0x56b9('0x17')](function(_0x16d874){logger[_0x56b9('0x14')]('ZendeskField,\x20%s,\x20%s',_0x22f98a,_0x16d874);_0x25f268(_0x16d874);});});}