Built motion from commit (unavailable).|2.5.29
[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 _0xb2bd=['then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5eb2fb,_0x2e203e){var _0x2e5503=function(_0x57628d){while(--_0x57628d){_0x5eb2fb['push'](_0x5eb2fb['shift']());}};_0x2e5503(++_0x2e203e);}(_0xb2bd,0x13e));var _0xdb2b=function(_0x3972f2,_0x2df623){_0x3972f2=_0x3972f2-0x0;var _0x4a2ba0=_0xb2bd[_0x3972f2];return _0x4a2ba0;};'use strict';var _=require(_0xdb2b('0x0'));var util=require(_0xdb2b('0x1'));var moment=require(_0xdb2b('0x2'));var BPromise=require(_0xdb2b('0x3'));var rs=require(_0xdb2b('0x4'));var fs=require('fs');var Redis=require(_0xdb2b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdb2b('0x6'))(_0xdb2b('0x7'));var config=require(_0xdb2b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdb2b('0x9')][_0xdb2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2173df,_0x590e6a,_0xd51b12){return new BPromise(function(_0x460199,_0x4e6660){return client[_0xdb2b('0xb')](_0x2173df,_0xd51b12)[_0xdb2b('0xc')](function(_0x5f449c){logger[_0xdb2b('0xd')](_0xdb2b('0xe'),_0x590e6a,_0xdb2b('0xf'));logger['debug'](_0xdb2b('0x10'),_0x590e6a,_0xdb2b('0xf'),JSON[_0xdb2b('0x11')](_0x5f449c));if(_0x5f449c['error']){if(_0x5f449c[_0xdb2b('0x12')]['code']===0x1f4){logger[_0xdb2b('0x12')](_0xdb2b('0xe'),_0x590e6a,_0x5f449c[_0xdb2b('0x12')][_0xdb2b('0x13')]);return _0x4e6660(_0x5f449c[_0xdb2b('0x12')]['message']);}logger[_0xdb2b('0x12')](_0xdb2b('0xe'),_0x590e6a,_0x5f449c['error'][_0xdb2b('0x13')]);return _0x460199(_0x5f449c['error'][_0xdb2b('0x13')]);}else{logger[_0xdb2b('0xd')](_0xdb2b('0xe'),_0x590e6a,_0xdb2b('0xf'));_0x460199(_0x5f449c[_0xdb2b('0x14')]['message']);}})[_0xdb2b('0x15')](function(_0x47115a){logger[_0xdb2b('0x12')](_0xdb2b('0xe'),_0x590e6a,_0x47115a);_0x4e6660(_0x47115a);});});}