Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / api / intFreshdeskField / intFreshdeskField.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 _0x817f=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x49d9c2,_0x40163c){var _0x504586=function(_0x2aad37){while(--_0x2aad37){_0x49d9c2['push'](_0x49d9c2['shift']());}};_0x504586(++_0x40163c);}(_0x817f,0x147));var _0xf817=function(_0xdb5808,_0x58c067){_0xdb5808=_0xdb5808-0x0;var _0x111072=_0x817f[_0xdb5808];return _0x111072;};'use strict';var _=require(_0xf817('0x0'));var util=require(_0xf817('0x1'));var moment=require(_0xf817('0x2'));var BPromise=require(_0xf817('0x3'));var rs=require(_0xf817('0x4'));var fs=require('fs');var Redis=require(_0xf817('0x5'));var db=require(_0xf817('0x6'))['db'];var utils=require(_0xf817('0x7'));var logger=require(_0xf817('0x8'))(_0xf817('0x9'));var config=require(_0xf817('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf817('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59d289,_0x51e971,_0x40b245){return new BPromise(function(_0x573266,_0x52e269){return client[_0xf817('0xc')](_0x59d289,_0x40b245)[_0xf817('0xd')](function(_0xe314ff){logger[_0xf817('0xe')](_0xf817('0xf'),_0x51e971,_0xf817('0x10'));logger[_0xf817('0x11')](_0xf817('0x12'),_0x51e971,_0xf817('0x10'),JSON[_0xf817('0x13')](_0xe314ff));if(_0xe314ff[_0xf817('0x14')]){if(_0xe314ff[_0xf817('0x14')][_0xf817('0x15')]===0x1f4){logger[_0xf817('0x14')](_0xf817('0xf'),_0x51e971,_0xe314ff[_0xf817('0x14')][_0xf817('0x16')]);return _0x52e269(_0xe314ff[_0xf817('0x14')][_0xf817('0x16')]);}logger[_0xf817('0x14')](_0xf817('0xf'),_0x51e971,_0xe314ff[_0xf817('0x14')][_0xf817('0x16')]);return _0x573266(_0xe314ff[_0xf817('0x14')][_0xf817('0x16')]);}else{logger[_0xf817('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x51e971,_0xf817('0x10'));_0x573266(_0xe314ff[_0xf817('0x17')]['message']);}})[_0xf817('0x18')](function(_0x401e69){logger[_0xf817('0x14')](_0xf817('0xf'),_0x51e971,_0x401e69);_0x52e269(_0x401e69);});});}