9838bfa32e2428e1523211a1d536e2746e55c0af
[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 _0x5cdd=['request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x5cdd,0x12c));var _0xd5cd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5cdd[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xd5cd('0x0'));var util=require(_0xd5cd('0x1'));var moment=require('moment');var BPromise=require(_0xd5cd('0x2'));var rs=require(_0xd5cd('0x3'));var fs=require('fs');var Redis=require(_0xd5cd('0x4'));var db=require(_0xd5cd('0x5'))['db'];var utils=require(_0xd5cd('0x6'));var logger=require('../../config/logger')(_0xd5cd('0x7'));var config=require(_0xd5cd('0x8'));var jayson=require(_0xd5cd('0x9'));var client=jayson[_0xd5cd('0xa')][_0xd5cd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51d08f,_0x4c7a8c,_0x202f3b){return new BPromise(function(_0x198409,_0x24a6fb){return client[_0xd5cd('0xc')](_0x51d08f,_0x202f3b)[_0xd5cd('0xd')](function(_0x43869a){logger['info'](_0xd5cd('0xe'),_0x4c7a8c,_0xd5cd('0xf'));logger[_0xd5cd('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4c7a8c,_0xd5cd('0xf'),JSON[_0xd5cd('0x11')](_0x43869a));if(_0x43869a['error']){if(_0x43869a['error'][_0xd5cd('0x12')]===0x1f4){logger[_0xd5cd('0x13')](_0xd5cd('0xe'),_0x4c7a8c,_0x43869a[_0xd5cd('0x13')][_0xd5cd('0x14')]);return _0x24a6fb(_0x43869a[_0xd5cd('0x13')][_0xd5cd('0x14')]);}logger[_0xd5cd('0x13')](_0xd5cd('0xe'),_0x4c7a8c,_0x43869a['error']['message']);return _0x198409(_0x43869a[_0xd5cd('0x13')][_0xd5cd('0x14')]);}else{logger[_0xd5cd('0x15')](_0xd5cd('0xe'),_0x4c7a8c,_0xd5cd('0xf'));_0x198409(_0x43869a[_0xd5cd('0x16')][_0xd5cd('0x14')]);}})[_0xd5cd('0x17')](function(_0x2db0c1){logger[_0xd5cd('0x13')](_0xd5cd('0xe'),_0x4c7a8c,_0x2db0c1);_0x24a6fb(_0x2db0c1);});});}