b561d46b8b215c4f9384c87b428118f89fa8cb11
[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 _0x2af8=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4dd94c,_0x42ab61){var _0x41e92c=function(_0x56ab1d){while(--_0x56ab1d){_0x4dd94c['push'](_0x4dd94c['shift']());}};_0x41e92c(++_0x42ab61);}(_0x2af8,0x1e7));var _0x82af=function(_0x2a892b,_0x566da7){_0x2a892b=_0x2a892b-0x0;var _0x4ec5be=_0x2af8[_0x2a892b];return _0x4ec5be;};'use strict';var _=require(_0x82af('0x0'));var util=require(_0x82af('0x1'));var moment=require(_0x82af('0x2'));var BPromise=require(_0x82af('0x3'));var rs=require(_0x82af('0x4'));var fs=require('fs');var Redis=require(_0x82af('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x82af('0x6'));var config=require(_0x82af('0x7'));var jayson=require(_0x82af('0x8'));var client=jayson['client'][_0x82af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b095f,_0x1ac0e9,_0x43dcd7){return new BPromise(function(_0x132795,_0x3d77f5){return client[_0x82af('0xa')](_0x1b095f,_0x43dcd7)[_0x82af('0xb')](function(_0x5e6f35){logger[_0x82af('0xc')](_0x82af('0xd'),_0x1ac0e9,_0x82af('0xe'));logger[_0x82af('0xf')](_0x82af('0x10'),_0x1ac0e9,_0x82af('0xe'),JSON[_0x82af('0x11')](_0x5e6f35));if(_0x5e6f35[_0x82af('0x12')]){if(_0x5e6f35[_0x82af('0x12')][_0x82af('0x13')]===0x1f4){logger['error'](_0x82af('0xd'),_0x1ac0e9,_0x5e6f35[_0x82af('0x12')][_0x82af('0x14')]);return _0x3d77f5(_0x5e6f35[_0x82af('0x12')][_0x82af('0x14')]);}logger[_0x82af('0x12')](_0x82af('0xd'),_0x1ac0e9,_0x5e6f35[_0x82af('0x12')][_0x82af('0x14')]);return _0x132795(_0x5e6f35[_0x82af('0x12')]['message']);}else{logger[_0x82af('0xc')](_0x82af('0xd'),_0x1ac0e9,_0x82af('0xe'));_0x132795(_0x5e6f35[_0x82af('0x15')]['message']);}})[_0x82af('0x16')](function(_0x44156c){logger[_0x82af('0x12')](_0x82af('0xd'),_0x1ac0e9,_0x44156c);_0x3d77f5(_0x44156c);});});}