Built motion from commit 497d3d92.|2.5.43
[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 _0x753f=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','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'];(function(_0x549484,_0x475015){var _0x6dca8c=function(_0x317f58){while(--_0x317f58){_0x549484['push'](_0x549484['shift']());}};_0x6dca8c(++_0x475015);}(_0x753f,0x9d));var _0xf753=function(_0x2a9040,_0x398960){_0x2a9040=_0x2a9040-0x0;var _0x3d1168=_0x753f[_0x2a9040];return _0x3d1168;};'use strict';var _=require(_0xf753('0x0'));var util=require(_0xf753('0x1'));var moment=require(_0xf753('0x2'));var BPromise=require(_0xf753('0x3'));var rs=require(_0xf753('0x4'));var fs=require('fs');var Redis=require(_0xf753('0x5'));var db=require(_0xf753('0x6'))['db'];var utils=require(_0xf753('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf753('0x8'));var client=jayson[_0xf753('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf7aef7,_0x18a285,_0x28665f){return new BPromise(function(_0x13077c,_0x5b53e0){return client[_0xf753('0xa')](_0xf7aef7,_0x28665f)[_0xf753('0xb')](function(_0x57bac7){logger[_0xf753('0xc')](_0xf753('0xd'),_0x18a285,_0xf753('0xe'));logger[_0xf753('0xf')](_0xf753('0x10'),_0x18a285,_0xf753('0xe'),JSON[_0xf753('0x11')](_0x57bac7));if(_0x57bac7[_0xf753('0x12')]){if(_0x57bac7['error'][_0xf753('0x13')]===0x1f4){logger[_0xf753('0x12')](_0xf753('0xd'),_0x18a285,_0x57bac7[_0xf753('0x12')][_0xf753('0x14')]);return _0x5b53e0(_0x57bac7[_0xf753('0x12')][_0xf753('0x14')]);}logger[_0xf753('0x12')]('ZendeskField,\x20%s,\x20%s',_0x18a285,_0x57bac7[_0xf753('0x12')][_0xf753('0x14')]);return _0x13077c(_0x57bac7[_0xf753('0x12')][_0xf753('0x14')]);}else{logger[_0xf753('0xc')](_0xf753('0xd'),_0x18a285,_0xf753('0xe'));_0x13077c(_0x57bac7[_0xf753('0x15')][_0xf753('0x14')]);}})[_0xf753('0x16')](function(_0x297c60){logger[_0xf753('0x12')](_0xf753('0xd'),_0x18a285,_0x297c60);_0x5b53e0(_0x297c60);});});}