Built motion from commit (unavailable).|2.5.27
[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 _0x3c4a=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0xe4b9d8,_0x26bcfd){var _0x49d48f=function(_0x10a281){while(--_0x10a281){_0xe4b9d8['push'](_0xe4b9d8['shift']());}};_0x49d48f(++_0x26bcfd);}(_0x3c4a,0x105));var _0xa3c4=function(_0x2dfd2b,_0x522d82){_0x2dfd2b=_0x2dfd2b-0x0;var _0x3fda3a=_0x3c4a[_0x2dfd2b];return _0x3fda3a;};'use strict';var _=require(_0xa3c4('0x0'));var util=require('util');var moment=require(_0xa3c4('0x1'));var BPromise=require(_0xa3c4('0x2'));var rs=require(_0xa3c4('0x3'));var fs=require('fs');var Redis=require(_0xa3c4('0x4'));var db=require(_0xa3c4('0x5'))['db'];var utils=require(_0xa3c4('0x6'));var logger=require('../../config/logger')(_0xa3c4('0x7'));var config=require('../../config/environment');var jayson=require(_0xa3c4('0x8'));var client=jayson[_0xa3c4('0x9')][_0xa3c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b4864,_0x5f55ba,_0x1bf9f4){return new BPromise(function(_0xec6f43,_0x560241){return client[_0xa3c4('0xb')](_0x2b4864,_0x1bf9f4)[_0xa3c4('0xc')](function(_0x39c046){logger[_0xa3c4('0xd')](_0xa3c4('0xe'),_0x5f55ba,_0xa3c4('0xf'));logger[_0xa3c4('0x10')](_0xa3c4('0x11'),_0x5f55ba,'request\x20sent',JSON[_0xa3c4('0x12')](_0x39c046));if(_0x39c046[_0xa3c4('0x13')]){if(_0x39c046[_0xa3c4('0x13')][_0xa3c4('0x14')]===0x1f4){logger[_0xa3c4('0x13')](_0xa3c4('0xe'),_0x5f55ba,_0x39c046[_0xa3c4('0x13')][_0xa3c4('0x15')]);return _0x560241(_0x39c046[_0xa3c4('0x13')][_0xa3c4('0x15')]);}logger[_0xa3c4('0x13')](_0xa3c4('0xe'),_0x5f55ba,_0x39c046[_0xa3c4('0x13')][_0xa3c4('0x15')]);return _0xec6f43(_0x39c046['error']['message']);}else{logger[_0xa3c4('0xd')](_0xa3c4('0xe'),_0x5f55ba,_0xa3c4('0xf'));_0xec6f43(_0x39c046['result'][_0xa3c4('0x15')]);}})[_0xa3c4('0x16')](function(_0x3fad28){logger[_0xa3c4('0x13')]('ZendeskField,\x20%s,\x20%s',_0x5f55ba,_0x3fad28);_0x560241(_0x3fad28);});});}