2fe938f5a42b20f6fdbb5d9b73c486370772cbb8
[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 _0x929d=['jayson/promise','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33bfb3,_0xc8d3d2){var _0x5bc9dd=function(_0x804567){while(--_0x804567){_0x33bfb3['push'](_0x33bfb3['shift']());}};_0x5bc9dd(++_0xc8d3d2);}(_0x929d,0x98));var _0xd929=function(_0x44a81c,_0x119bba){_0x44a81c=_0x44a81c-0x0;var _0x507869=_0x929d[_0x44a81c];return _0x507869;};'use strict';var _=require(_0xd929('0x0'));var util=require(_0xd929('0x1'));var moment=require(_0xd929('0x2'));var BPromise=require(_0xd929('0x3'));var rs=require(_0xd929('0x4'));var fs=require('fs');var Redis=require(_0xd929('0x5'));var db=require(_0xd929('0x6'))['db'];var utils=require(_0xd929('0x7'));var logger=require(_0xd929('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd929('0x9'));var client=jayson['client'][_0xd929('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ae7d7,_0x3d70f2,_0x411d83){return new BPromise(function(_0xa2a978,_0x44c623){return client['request'](_0x5ae7d7,_0x411d83)[_0xd929('0xb')](function(_0x26291e){logger[_0xd929('0xc')](_0xd929('0xd'),_0x3d70f2,_0xd929('0xe'));logger[_0xd929('0xf')](_0xd929('0x10'),_0x3d70f2,_0xd929('0xe'),JSON[_0xd929('0x11')](_0x26291e));if(_0x26291e[_0xd929('0x12')]){if(_0x26291e[_0xd929('0x12')][_0xd929('0x13')]===0x1f4){logger['error'](_0xd929('0xd'),_0x3d70f2,_0x26291e[_0xd929('0x12')][_0xd929('0x14')]);return _0x44c623(_0x26291e['error'][_0xd929('0x14')]);}logger['error'](_0xd929('0xd'),_0x3d70f2,_0x26291e[_0xd929('0x12')]['message']);return _0xa2a978(_0x26291e[_0xd929('0x12')][_0xd929('0x14')]);}else{logger[_0xd929('0xc')](_0xd929('0xd'),_0x3d70f2,_0xd929('0xe'));_0xa2a978(_0x26291e[_0xd929('0x15')][_0xd929('0x14')]);}})[_0xd929('0x16')](function(_0x3c4b4e){logger[_0xd929('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x3d70f2,_0x3c4b4e);_0x44c623(_0x3c4b4e);});});}