Built motion from commit 4fa9d4a7.|2.6.31
[motion2.git] / server / api / chatWebsite / index.js
index 22e0765..131eacb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bc2=['/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','now','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addApplications','addProactiveActions','put','update','delete','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x4e817c,_0x377b98){var _0x2f7a9f=function(_0x48b8d4){while(--_0x48b8d4){_0x4e817c['push'](_0x4e817c['shift']());}};_0x2f7a9f(++_0x377b98);}(_0x6bc2,0x73));var _0x26bc=function(_0xbbc85e,_0x100d7c){_0xbbc85e=_0xbbc85e-0x0;var _0x43d533=_0x6bc2[_0xbbc85e];return _0x43d533;};'use strict';var multer=require(_0x26bc('0x0'));var util=require(_0x26bc('0x1'));var path=require(_0x26bc('0x2'));var timeout=require(_0x26bc('0x3'));var express=require(_0x26bc('0x4'));var router=express[_0x26bc('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x26bc('0x6'));var config=require(_0x26bc('0x7'));var controller=require(_0x26bc('0x8'));router[_0x26bc('0x9')]('/',auth['isAuthenticated'](),controller[_0x26bc('0xa')]);router[_0x26bc('0x9')](_0x26bc('0xb'),auth['isAuthenticated'](),controller[_0x26bc('0xc')]);router['get'](_0x26bc('0xd'),auth['isAuthenticated'](),controller[_0x26bc('0xe')]);router['get'](_0x26bc('0xf'),auth[_0x26bc('0x10')](),controller[_0x26bc('0x11')]);router[_0x26bc('0x9')](_0x26bc('0x12'),auth[_0x26bc('0x10')](),controller[_0x26bc('0x13')]);router[_0x26bc('0x9')](_0x26bc('0x14'),controller[_0x26bc('0x15')]);router['get'](_0x26bc('0x16'),controller[_0x26bc('0x17')]);router[_0x26bc('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x26bc('0x9')]('/:id/system_avatar',controller[_0x26bc('0x18')]);router[_0x26bc('0x9')](_0x26bc('0x19'),auth['isAuthenticated'](),controller[_0x26bc('0x1a')]);router['get']('/:id/snippet',controller['getSnippet']);router['get'](_0x26bc('0x1b'),auth[_0x26bc('0x10')](),controller[_0x26bc('0x1c')]);router[_0x26bc('0x9')](_0x26bc('0x1d'),auth[_0x26bc('0x10')](),controller[_0x26bc('0x1e')]);router['get'](_0x26bc('0x1f'),controller['getFields']);router[_0x26bc('0x9')]('/:id/offline_messages',auth[_0x26bc('0x10')](),controller[_0x26bc('0x20')]);router[_0x26bc('0x9')](_0x26bc('0x21'),auth[_0x26bc('0x10')](),controller['getAgents']);router[_0x26bc('0x22')]('/',auth['isAuthenticated'](),controller[_0x26bc('0x23')]);router[_0x26bc('0x22')]('/:id/dispositions',auth[_0x26bc('0x10')](),controller[_0x26bc('0x24')]);router[_0x26bc('0x22')](_0x26bc('0x12'),auth[_0x26bc('0x10')](),controller[_0x26bc('0x25')]);var upload=multer({'storage':multer[_0x26bc('0x26')]({'destination':function(_0x571e9c,_0x30553b,_0x11ea47){_0x11ea47(null,path[_0x26bc('0x27')](config[_0x26bc('0x28')],_0x26bc('0x29')));},'filename':function(_0x5aca93,_0xd28057,_0x32ce55){_0x32ce55(null,util[_0x26bc('0x2a')](_0x26bc('0x2b'),Date['now'](),_0xd28057[_0x26bc('0x2c')]));}})});router[_0x26bc('0x22')](_0x26bc('0x14'),upload[_0x26bc('0x2d')](_0x26bc('0x2e')),controller[_0x26bc('0x2f')]);var upload=multer({'storage':multer[_0x26bc('0x26')]({'destination':function(_0xc69959,_0x101a55,_0xe2c5d6){_0xe2c5d6(null,path[_0x26bc('0x27')](config['root'],_0x26bc('0x30')));},'filename':function(_0x16120d,_0x1de5bc,_0x44b482){_0x44b482(null,util[_0x26bc('0x2a')]('%s-%s',Date['now'](),_0x1de5bc['originalname']));}})});router[_0x26bc('0x22')](_0x26bc('0x16'),upload[_0x26bc('0x2d')](_0x26bc('0x2e')),controller[_0x26bc('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1eefd1,_0x554ab7,_0x4b1532){_0x4b1532(null,path[_0x26bc('0x27')](config[_0x26bc('0x28')],_0x26bc('0x30')));},'filename':function(_0x4e7e80,_0x5b1388,_0xb764a9){_0xb764a9(null,util[_0x26bc('0x2a')](_0x26bc('0x2b'),Date[_0x26bc('0x32')](),_0x5b1388[_0x26bc('0x2c')]));}})});router[_0x26bc('0x22')]('/:id/customer_avatar',upload[_0x26bc('0x2d')](_0x26bc('0x2e')),controller[_0x26bc('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x416167,_0x4b18d3,_0x50d6c8){_0x50d6c8(null,path['join'](config[_0x26bc('0x28')],'server/files/images/avatars/'));},'filename':function(_0x44ce63,_0x240f91,_0xb9438){_0xb9438(null,util['format'](_0x26bc('0x2b'),Date[_0x26bc('0x32')](),_0x240f91[_0x26bc('0x2c')]));}})});router[_0x26bc('0x22')](_0x26bc('0x34'),upload[_0x26bc('0x2d')](_0x26bc('0x2e')),controller[_0x26bc('0x35')]);router[_0x26bc('0x22')](_0x26bc('0x36'),controller[_0x26bc('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x26bc('0x26')]({'destination':function(_0x19b517,_0x10337f,_0x53c4e9){const _0x1bb9dd=path['join'](config['root'],'server/files',_0x26bc('0x38'),_0x26bc('0x39'));fs_extra[_0x26bc('0x3a')](_0x1bb9dd,function(){_0x53c4e9(null,_0x1bb9dd);});},'filename':function(_0x385cc1,_0x1ebc2a,_0x1d1aa2){const _0x248e0d=_0x1ebc2a[_0x26bc('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x45ba30=path[_0x26bc('0x3b')](_0x248e0d);const _0x2eaba5=Date['now']()+'-'+_0x248e0d[_0x26bc('0x3c')](_0x45ba30,'')+_0x45ba30;_0x1d1aa2(null,_0x2eaba5);}})});router[_0x26bc('0x22')](_0x26bc('0x3d'),offlineUploadMulter[_0x26bc('0x3e')](),controller[_0x26bc('0x3f')]);router[_0x26bc('0x22')](_0x26bc('0x19'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x26bc('0x1b'),auth[_0x26bc('0x10')](),controller[_0x26bc('0x40')]);router[_0x26bc('0x22')]('/:id/proactive_actions',auth[_0x26bc('0x10')](),controller[_0x26bc('0x41')]);router[_0x26bc('0x22')](_0x26bc('0x21'),auth[_0x26bc('0x10')](),controller['addAgents']);router[_0x26bc('0x42')](_0x26bc('0xd'),auth[_0x26bc('0x10')](),controller[_0x26bc('0x43')]);router['delete'](_0x26bc('0xd'),auth[_0x26bc('0x10')](),controller['destroy']);router[_0x26bc('0x44')](_0x26bc('0xf'),auth[_0x26bc('0x10')](),controller['removeDispositions']);router[_0x26bc('0x44')](_0x26bc('0x12'),auth[_0x26bc('0x10')](),controller[_0x26bc('0x45')]);router[_0x26bc('0x44')](_0x26bc('0x21'),auth[_0x26bc('0x10')](),controller['removeAgents']);module[_0x26bc('0x46')]=router;
\ No newline at end of file
+var _0x6622=['../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','single','file','join','server/files/images/avatars/','addAvatar','addCustomerAvatar','originalname','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','express','fs-extra','../../components/auth/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6622,0x172));var _0x2662=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x6622[_0x38c699];return _0x3b1ded;};'use strict';var multer=require(_0x2662('0x0'));var util=require('util');var path=require(_0x2662('0x1'));var timeout=require('connect-timeout');var express=require(_0x2662('0x2'));var router=express['Router']();var fs_extra=require(_0x2662('0x3'));var auth=require(_0x2662('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2662('0x5'));var controller=require(_0x2662('0x6'));router[_0x2662('0x7')]('/',auth[_0x2662('0x8')](),controller[_0x2662('0x9')]);router['get'](_0x2662('0xa'),auth[_0x2662('0x8')](),controller[_0x2662('0xb')]);router['get'](_0x2662('0xc'),auth[_0x2662('0x8')](),controller['show']);router[_0x2662('0x7')](_0x2662('0xd'),auth[_0x2662('0x8')](),controller[_0x2662('0xe')]);router['get'](_0x2662('0xf'),auth['isAuthenticated'](),controller[_0x2662('0x10')]);router[_0x2662('0x7')](_0x2662('0x11'),controller[_0x2662('0x12')]);router['get'](_0x2662('0x13'),controller[_0x2662('0x14')]);router[_0x2662('0x7')](_0x2662('0x15'),controller[_0x2662('0x16')]);router['get'](_0x2662('0x17'),controller[_0x2662('0x18')]);router[_0x2662('0x7')](_0x2662('0x19'),auth['isAuthenticated'](),controller[_0x2662('0x1a')]);router[_0x2662('0x7')](_0x2662('0x1b'),controller[_0x2662('0x1c')]);router[_0x2662('0x7')](_0x2662('0x1d'),auth[_0x2662('0x8')](),controller[_0x2662('0x1e')]);router[_0x2662('0x7')]('/:id/proactive_actions',auth[_0x2662('0x8')](),controller[_0x2662('0x1f')]);router['get'](_0x2662('0x20'),controller[_0x2662('0x21')]);router[_0x2662('0x7')](_0x2662('0x22'),auth[_0x2662('0x8')](),controller[_0x2662('0x23')]);router[_0x2662('0x7')](_0x2662('0x24'),auth[_0x2662('0x8')](),controller[_0x2662('0x25')]);router[_0x2662('0x26')]('/',auth[_0x2662('0x8')](),controller['create']);router[_0x2662('0x26')](_0x2662('0xd'),auth['isAuthenticated'](),controller[_0x2662('0x27')]);router[_0x2662('0x26')]('/:id/canned_answers',auth[_0x2662('0x8')](),controller[_0x2662('0x28')]);var upload=multer({'storage':multer[_0x2662('0x29')]({'destination':function(_0x43a24e,_0x23dd3c,_0x11c0cb){_0x11c0cb(null,path['join'](config[_0x2662('0x2a')],_0x2662('0x2b')));},'filename':function(_0x25d7e7,_0x3f5190,_0x1e6a90){_0x1e6a90(null,util[_0x2662('0x2c')](_0x2662('0x2d'),Date[_0x2662('0x2e')](),_0x3f5190['originalname']));}})});router[_0x2662('0x26')](_0x2662('0x11'),upload[_0x2662('0x2f')](_0x2662('0x30')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46e933,_0x22cd96,_0x201f24){_0x201f24(null,path[_0x2662('0x31')](config['root'],_0x2662('0x32')));},'filename':function(_0x2ba57f,_0x15d712,_0x2cbcbf){_0x2cbcbf(null,util['format']('%s-%s',Date[_0x2662('0x2e')](),_0x15d712['originalname']));}})});router[_0x2662('0x26')](_0x2662('0x13'),upload[_0x2662('0x2f')]('file'),controller[_0x2662('0x33')]);var upload=multer({'storage':multer[_0x2662('0x29')]({'destination':function(_0x139c9f,_0x194675,_0x3f1c6c){_0x3f1c6c(null,path[_0x2662('0x31')](config[_0x2662('0x2a')],_0x2662('0x32')));},'filename':function(_0x2f4992,_0x3d26d5,_0x288c3f){_0x288c3f(null,util['format'](_0x2662('0x2d'),Date[_0x2662('0x2e')](),_0x3d26d5['originalname']));}})});router[_0x2662('0x26')]('/:id/customer_avatar',upload[_0x2662('0x2f')](_0x2662('0x30')),controller[_0x2662('0x34')]);var upload=multer({'storage':multer[_0x2662('0x29')]({'destination':function(_0x1a0015,_0x301cb9,_0x49b604){_0x49b604(null,path[_0x2662('0x31')](config[_0x2662('0x2a')],_0x2662('0x32')));},'filename':function(_0x94ca49,_0x111e8f,_0x5ef001){_0x5ef001(null,util[_0x2662('0x2c')](_0x2662('0x2d'),Date[_0x2662('0x2e')](),_0x111e8f[_0x2662('0x35')]));}})});router['post']('/:id/system_avatar',upload[_0x2662('0x2f')](_0x2662('0x30')),controller[_0x2662('0x36')]);router[_0x2662('0x26')](_0x2662('0x37'),controller[_0x2662('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x2662('0x29')]({'destination':function(_0x327d95,_0x5855f6,_0x140d08){const _0x27adf6=path[_0x2662('0x31')](config[_0x2662('0x2a')],_0x2662('0x39'),_0x2662('0x3a'),_0x2662('0x3b'));fs_extra[_0x2662('0x3c')](_0x27adf6,function(){_0x140d08(null,_0x27adf6);});},'filename':function(_0x1e7eb3,_0x58d030,_0x235553){const _0x4c8a51=_0x58d030[_0x2662('0x35')][_0x2662('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x327755=path[_0x2662('0x3e')](_0x4c8a51);const _0x222f93=Date[_0x2662('0x2e')]()+'-'+_0x4c8a51[_0x2662('0x3d')](_0x327755,'')+_0x327755;_0x235553(null,_0x222f93);}})});router[_0x2662('0x26')](_0x2662('0x3f'),offlineUploadMulter['any'](),controller[_0x2662('0x40')]);router['post']('/:id/interactions',auth[_0x2662('0x8')](),controller[_0x2662('0x41')]);router[_0x2662('0x26')](_0x2662('0x1d'),auth[_0x2662('0x8')](),controller['addApplications']);router[_0x2662('0x26')](_0x2662('0x42'),auth['isAuthenticated'](),controller[_0x2662('0x43')]);router[_0x2662('0x26')](_0x2662('0x24'),auth[_0x2662('0x8')](),controller[_0x2662('0x44')]);router['put']('/:id',auth[_0x2662('0x8')](),controller[_0x2662('0x45')]);router[_0x2662('0x46')](_0x2662('0xc'),auth[_0x2662('0x8')](),controller[_0x2662('0x47')]);router['delete'](_0x2662('0xd'),auth[_0x2662('0x8')](),controller[_0x2662('0x48')]);router[_0x2662('0x46')](_0x2662('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x2662('0x46')](_0x2662('0x24'),auth[_0x2662('0x8')](),controller[_0x2662('0x49')]);module[_0x2662('0x4a')]=router;
\ No newline at end of file