Built motion from commit 9d0783e6.|2.6.13
[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 _0x44fa=['http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x36c6f8,_0x17cb72){var _0x240ff0=function(_0x3a369d){while(--_0x3a369d){_0x36c6f8['push'](_0x36c6f8['shift']());}};_0x240ff0(++_0x17cb72);}(_0x44fa,0x1b7));var _0xa44f=function(_0x1205b1,_0x2a7010){_0x1205b1=_0x1205b1-0x0;var _0x2d3bad=_0x44fa[_0x1205b1];return _0x2d3bad;};'use strict';var _=require(_0xa44f('0x0'));var util=require(_0xa44f('0x1'));var moment=require(_0xa44f('0x2'));var BPromise=require(_0xa44f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa44f('0x4'));var db=require(_0xa44f('0x5'))['db'];var utils=require(_0xa44f('0x6'));var logger=require(_0xa44f('0x7'))('rpc');var config=require(_0xa44f('0x8'));var jayson=require(_0xa44f('0x9'));var client=jayson[_0xa44f('0xa')][_0xa44f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb79317,_0x99f50d,_0x2a8ac9){return new BPromise(function(_0x4c2747,_0x44eda5){return client[_0xa44f('0xc')](_0xb79317,_0x2a8ac9)[_0xa44f('0xd')](function(_0x58382d){logger[_0xa44f('0xe')](_0xa44f('0xf'),_0x99f50d,_0xa44f('0x10'));logger[_0xa44f('0x11')](_0xa44f('0x12'),_0x99f50d,_0xa44f('0x10'),JSON[_0xa44f('0x13')](_0x58382d));if(_0x58382d['error']){if(_0x58382d[_0xa44f('0x14')][_0xa44f('0x15')]===0x1f4){logger['error'](_0xa44f('0xf'),_0x99f50d,_0x58382d[_0xa44f('0x14')][_0xa44f('0x16')]);return _0x44eda5(_0x58382d[_0xa44f('0x14')][_0xa44f('0x16')]);}logger['error'](_0xa44f('0xf'),_0x99f50d,_0x58382d['error'][_0xa44f('0x16')]);return _0x4c2747(_0x58382d[_0xa44f('0x14')][_0xa44f('0x16')]);}else{logger[_0xa44f('0xe')]('ZendeskField,\x20%s,\x20%s',_0x99f50d,'request\x20sent');_0x4c2747(_0x58382d[_0xa44f('0x17')][_0xa44f('0x16')]);}})[_0xa44f('0x18')](function(_0x4f0e34){logger[_0xa44f('0x14')](_0xa44f('0xf'),_0x99f50d,_0x4f0e34);_0x44eda5(_0x4f0e34);});});}