Built motion from commit (unavailable).|2.5.15
[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 _0xaf77=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x4071cc,_0x2ba75f){var _0x2f2f8c=function(_0x5bd564){while(--_0x5bd564){_0x4071cc['push'](_0x4071cc['shift']());}};_0x2f2f8c(++_0x2ba75f);}(_0xaf77,0x19d));var _0x7af7=function(_0x204ad1,_0x53ca97){_0x204ad1=_0x204ad1-0x0;var _0x57050e=_0xaf77[_0x204ad1];return _0x57050e;};'use strict';var _=require('lodash');var util=require(_0x7af7('0x0'));var moment=require(_0x7af7('0x1'));var BPromise=require(_0x7af7('0x2'));var rs=require(_0x7af7('0x3'));var fs=require('fs');var Redis=require(_0x7af7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7af7('0x5'));var logger=require(_0x7af7('0x6'))(_0x7af7('0x7'));var config=require('../../config/environment');var jayson=require(_0x7af7('0x8'));var client=jayson[_0x7af7('0x9')][_0x7af7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x404da7,_0x80b8ee,_0x317dd9){return new BPromise(function(_0x398d59,_0x5a56ce){return client['request'](_0x404da7,_0x317dd9)[_0x7af7('0xb')](function(_0x4e64da){logger[_0x7af7('0xc')]('ZendeskField,\x20%s,\x20%s',_0x80b8ee,'request\x20sent');logger[_0x7af7('0xd')](_0x7af7('0xe'),_0x80b8ee,'request\x20sent',JSON[_0x7af7('0xf')](_0x4e64da));if(_0x4e64da[_0x7af7('0x10')]){if(_0x4e64da[_0x7af7('0x10')][_0x7af7('0x11')]===0x1f4){logger['error'](_0x7af7('0x12'),_0x80b8ee,_0x4e64da[_0x7af7('0x10')][_0x7af7('0x13')]);return _0x5a56ce(_0x4e64da[_0x7af7('0x10')][_0x7af7('0x13')]);}logger['error'](_0x7af7('0x12'),_0x80b8ee,_0x4e64da[_0x7af7('0x10')][_0x7af7('0x13')]);return _0x398d59(_0x4e64da['error'][_0x7af7('0x13')]);}else{logger[_0x7af7('0xc')](_0x7af7('0x12'),_0x80b8ee,_0x7af7('0x14'));_0x398d59(_0x4e64da[_0x7af7('0x15')][_0x7af7('0x13')]);}})['catch'](function(_0x3a64c7){logger['error'](_0x7af7('0x12'),_0x80b8ee,_0x3a64c7);_0x5a56ce(_0x3a64c7);});});}