Built motion from commit e6806ed6.|2.6.0
[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 _0x4ec8=['error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','code'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ec8,0x180));var _0x84ec=function(_0x2087cf,_0x5021f9){_0x2087cf=_0x2087cf-0x0;var _0x5d1fb3=_0x4ec8[_0x2087cf];return _0x5d1fb3;};'use strict';var _=require(_0x84ec('0x0'));var util=require('util');var moment=require(_0x84ec('0x1'));var BPromise=require(_0x84ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84ec('0x3'))['db'];var utils=require(_0x84ec('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x84ec('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x84ec('0x6')][_0x84ec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x26c2a5,_0x258bf8,_0x166894){return new BPromise(function(_0x53c08b,_0x308a19){return client[_0x84ec('0x8')](_0x26c2a5,_0x166894)[_0x84ec('0x9')](function(_0x25a0d2){logger[_0x84ec('0xa')](_0x84ec('0xb'),_0x258bf8,_0x84ec('0xc'));logger['debug'](_0x84ec('0xd'),_0x258bf8,_0x84ec('0xc'),JSON['stringify'](_0x25a0d2));if(_0x25a0d2['error']){if(_0x25a0d2['error'][_0x84ec('0xe')]===0x1f4){logger[_0x84ec('0xf')](_0x84ec('0xb'),_0x258bf8,_0x25a0d2[_0x84ec('0xf')][_0x84ec('0x10')]);return _0x308a19(_0x25a0d2[_0x84ec('0xf')][_0x84ec('0x10')]);}logger[_0x84ec('0xf')](_0x84ec('0xb'),_0x258bf8,_0x25a0d2[_0x84ec('0xf')][_0x84ec('0x10')]);return _0x53c08b(_0x25a0d2[_0x84ec('0xf')][_0x84ec('0x10')]);}else{logger[_0x84ec('0xa')](_0x84ec('0xb'),_0x258bf8,_0x84ec('0xc'));_0x53c08b(_0x25a0d2[_0x84ec('0x11')][_0x84ec('0x10')]);}})[_0x84ec('0x12')](function(_0x13113f){logger[_0x84ec('0xf')](_0x84ec('0xb'),_0x258bf8,_0x13113f);_0x308a19(_0x13113f);});});}