Built motion from commit 85328c08.|2.5.50
[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 _0x25c1=['request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x72e08e,_0x5bc441){var _0x477837=function(_0x58c62b){while(--_0x58c62b){_0x72e08e['push'](_0x72e08e['shift']());}};_0x477837(++_0x5bc441);}(_0x25c1,0x17b));var _0x125c=function(_0x4947f4,_0x4096b8){_0x4947f4=_0x4947f4-0x0;var _0x5972ca=_0x25c1[_0x4947f4];return _0x5972ca;};'use strict';var _=require(_0x125c('0x0'));var util=require('util');var moment=require(_0x125c('0x1'));var BPromise=require(_0x125c('0x2'));var rs=require(_0x125c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x125c('0x4'))['db'];var utils=require(_0x125c('0x5'));var logger=require(_0x125c('0x6'))(_0x125c('0x7'));var config=require(_0x125c('0x8'));var jayson=require(_0x125c('0x9'));var client=jayson[_0x125c('0xa')][_0x125c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eb1f6,_0x6444ff,_0x39724a){return new BPromise(function(_0x5a0e29,_0x33c68f){return client[_0x125c('0xc')](_0x2eb1f6,_0x39724a)[_0x125c('0xd')](function(_0x93829a){logger[_0x125c('0xe')](_0x125c('0xf'),_0x6444ff,_0x125c('0x10'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x6444ff,'request\x20sent',JSON[_0x125c('0x11')](_0x93829a));if(_0x93829a['error']){if(_0x93829a[_0x125c('0x12')][_0x125c('0x13')]===0x1f4){logger[_0x125c('0x12')](_0x125c('0xf'),_0x6444ff,_0x93829a[_0x125c('0x12')][_0x125c('0x14')]);return _0x33c68f(_0x93829a['error'][_0x125c('0x14')]);}logger['error'](_0x125c('0xf'),_0x6444ff,_0x93829a[_0x125c('0x12')][_0x125c('0x14')]);return _0x5a0e29(_0x93829a[_0x125c('0x12')][_0x125c('0x14')]);}else{logger[_0x125c('0xe')](_0x125c('0xf'),_0x6444ff,_0x125c('0x10'));_0x5a0e29(_0x93829a[_0x125c('0x15')][_0x125c('0x14')]);}})[_0x125c('0x16')](function(_0x86be27){logger[_0x125c('0x12')](_0x125c('0xf'),_0x6444ff,_0x86be27);_0x33c68f(_0x86be27);});});}