Built motion from commit (unavailable).|2.5.31
[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 _0x4b0d=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x4b0d,0xe8));var _0xd4b0=function(_0x1d56fd,_0x36c2d4){_0x1d56fd=_0x1d56fd-0x0;var _0x1f9f71=_0x4b0d[_0x1d56fd];return _0x1f9f71;};'use strict';var _=require(_0xd4b0('0x0'));var util=require(_0xd4b0('0x1'));var moment=require(_0xd4b0('0x2'));var BPromise=require(_0xd4b0('0x3'));var rs=require(_0xd4b0('0x4'));var fs=require('fs');var Redis=require(_0xd4b0('0x5'));var db=require(_0xd4b0('0x6'))['db'];var utils=require(_0xd4b0('0x7'));var logger=require(_0xd4b0('0x8'))(_0xd4b0('0x9'));var config=require(_0xd4b0('0xa'));var jayson=require(_0xd4b0('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3e00,_0x36cd66,_0xe2921c){return new BPromise(function(_0x2282a6,_0x42e4d3){return client[_0xd4b0('0xc')](_0x4e3e00,_0xe2921c)[_0xd4b0('0xd')](function(_0x2c5231){logger['info'](_0xd4b0('0xe'),_0x36cd66,'request\x20sent');logger[_0xd4b0('0xf')](_0xd4b0('0x10'),_0x36cd66,_0xd4b0('0x11'),JSON[_0xd4b0('0x12')](_0x2c5231));if(_0x2c5231[_0xd4b0('0x13')]){if(_0x2c5231[_0xd4b0('0x13')][_0xd4b0('0x14')]===0x1f4){logger[_0xd4b0('0x13')](_0xd4b0('0xe'),_0x36cd66,_0x2c5231['error']['message']);return _0x42e4d3(_0x2c5231[_0xd4b0('0x13')][_0xd4b0('0x15')]);}logger[_0xd4b0('0x13')](_0xd4b0('0xe'),_0x36cd66,_0x2c5231[_0xd4b0('0x13')][_0xd4b0('0x15')]);return _0x2282a6(_0x2c5231['error'][_0xd4b0('0x15')]);}else{logger['info'](_0xd4b0('0xe'),_0x36cd66,_0xd4b0('0x11'));_0x2282a6(_0x2c5231['result']['message']);}})[_0xd4b0('0x16')](function(_0x2f8723){logger[_0xd4b0('0x13')](_0xd4b0('0xe'),_0x36cd66,_0x2f8723);_0x42e4d3(_0x2f8723);});});}