Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / chatWebsite / index.js
index 7136c7b..99ff68b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6dd=['getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','diskStorage','join','root','server/files/images/logos/','format','now','single','file','addLogo','%s-%s','originalname','/:id/avatar','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','express','Router','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/snippet','getSnippet','/:id/applications'];(function(_0x2e3f29,_0x2fc512){var _0x203ffb=function(_0x277893){while(--_0x277893){_0x2e3f29['push'](_0x2e3f29['shift']());}};_0x203ffb(++_0x2fc512);}(_0xc6dd,0xf6));var _0xdc6d=function(_0x5a260d,_0x3018ed){_0x5a260d=_0x5a260d-0x0;var _0x404d96=_0xc6dd[_0x5a260d];return _0x404d96;};'use strict';var multer=require('multer');var util=require(_0xdc6d('0x0'));var path=require(_0xdc6d('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc6d('0x2'));var router=express[_0xdc6d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdc6d('0x4'));var controller=require(_0xdc6d('0x5'));router[_0xdc6d('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdc6d('0x6')](_0xdc6d('0x7'),auth[_0xdc6d('0x8')](),controller['describe']);router[_0xdc6d('0x6')]('/:id',auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x9')]);router[_0xdc6d('0x6')](_0xdc6d('0xa'),auth[_0xdc6d('0x8')](),controller['getDispositions']);router[_0xdc6d('0x6')](_0xdc6d('0xb'),auth[_0xdc6d('0x8')](),controller[_0xdc6d('0xc')]);router[_0xdc6d('0x6')](_0xdc6d('0xd'),controller[_0xdc6d('0xe')]);router[_0xdc6d('0x6')]('/:id/avatar',controller[_0xdc6d('0xf')]);router[_0xdc6d('0x6')](_0xdc6d('0x10'),controller[_0xdc6d('0x11')]);router['get'](_0xdc6d('0x12'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0xdc6d('0x8')](),controller['getInteractions']);router[_0xdc6d('0x6')](_0xdc6d('0x13'),controller[_0xdc6d('0x14')]);router['get'](_0xdc6d('0x15'),auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x16')]);router[_0xdc6d('0x6')]('/:id/proactive_actions',auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x17')]);router['get'](_0xdc6d('0x18'),controller[_0xdc6d('0x19')]);router[_0xdc6d('0x6')](_0xdc6d('0x1a'),auth['isAuthenticated'](),controller[_0xdc6d('0x1b')]);router[_0xdc6d('0x6')](_0xdc6d('0x1c'),auth['isAuthenticated'](),controller['getAgents']);router[_0xdc6d('0x1d')]('/',auth[_0xdc6d('0x8')](),controller['create']);router['post'](_0xdc6d('0xa'),auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x1e')]);router[_0xdc6d('0x1d')](_0xdc6d('0xb'),auth[_0xdc6d('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xdc6d('0x1f')]({'destination':function(_0x31ffb6,_0x16e508,_0x596b19){_0x596b19(null,path[_0xdc6d('0x20')](config[_0xdc6d('0x21')],_0xdc6d('0x22')));},'filename':function(_0x4c951a,_0x1e2197,_0x3f93b3){_0x3f93b3(null,util[_0xdc6d('0x23')]('%s-%s',Date[_0xdc6d('0x24')](),_0x1e2197['originalname']));}})});router['post'](_0xdc6d('0xd'),upload[_0xdc6d('0x25')](_0xdc6d('0x26')),controller[_0xdc6d('0x27')]);var upload=multer({'storage':multer[_0xdc6d('0x1f')]({'destination':function(_0x41e1a5,_0xba6cca,_0x3f9735){_0x3f9735(null,path[_0xdc6d('0x20')](config[_0xdc6d('0x21')],'server/files/images/avatars/'));},'filename':function(_0x2a08b2,_0x3c0eeb,_0x5106e9){_0x5106e9(null,util[_0xdc6d('0x23')](_0xdc6d('0x28'),Date[_0xdc6d('0x24')](),_0x3c0eeb[_0xdc6d('0x29')]));}})});router[_0xdc6d('0x1d')](_0xdc6d('0x2a'),upload['single']('file'),controller[_0xdc6d('0x2b')]);var upload=multer({'storage':multer[_0xdc6d('0x1f')]({'destination':function(_0x107a0d,_0x461a67,_0x3e6236){_0x3e6236(null,path[_0xdc6d('0x20')](config[_0xdc6d('0x21')],_0xdc6d('0x2c')));},'filename':function(_0x1e00c0,_0x1443b4,_0x3b4fd5){_0x3b4fd5(null,util[_0xdc6d('0x23')](_0xdc6d('0x28'),Date[_0xdc6d('0x24')](),_0x1443b4[_0xdc6d('0x29')]));}})});router[_0xdc6d('0x1d')](_0xdc6d('0x10'),upload[_0xdc6d('0x25')](_0xdc6d('0x26')),controller[_0xdc6d('0x2d')]);var upload=multer({'storage':multer[_0xdc6d('0x1f')]({'destination':function(_0x2cfbfe,_0x3f1971,_0x52dc8c){_0x52dc8c(null,path[_0xdc6d('0x20')](config[_0xdc6d('0x21')],_0xdc6d('0x2c')));},'filename':function(_0x1de703,_0x49f3cf,_0x40074f){_0x40074f(null,util['format'](_0xdc6d('0x28'),Date[_0xdc6d('0x24')](),_0x49f3cf['originalname']));}})});router[_0xdc6d('0x1d')]('/:id/system_avatar',upload['single'](_0xdc6d('0x26')),controller[_0xdc6d('0x2e')]);router[_0xdc6d('0x1d')](_0xdc6d('0x2f'),controller[_0xdc6d('0x30')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0xb4b474,_0x38d640,_0x3127d6){const _0x5b23b4=path[_0xdc6d('0x20')](config[_0xdc6d('0x21')],_0xdc6d('0x31'),_0xdc6d('0x32'),_0xdc6d('0x33'));fs_extra[_0xdc6d('0x34')](_0x5b23b4,function(){_0x3127d6(null,_0x5b23b4);});},'filename':function(_0x12ea20,_0xe2ac26,_0x255778){const _0x9a4589=_0xe2ac26[_0xdc6d('0x29')][_0xdc6d('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4cb25e=path[_0xdc6d('0x36')](_0x9a4589);const _0x30fbd1=Date[_0xdc6d('0x24')]()+'-'+_0x9a4589[_0xdc6d('0x35')](_0x4cb25e,'')+_0x4cb25e;_0x255778(null,_0x30fbd1);}})});router[_0xdc6d('0x1d')](_0xdc6d('0x37'),offlineUploadMulter['any'](),controller['offline']);router[_0xdc6d('0x1d')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xdc6d('0x38')]);router[_0xdc6d('0x1d')](_0xdc6d('0x15'),auth[_0xdc6d('0x8')](),controller['addApplications']);router[_0xdc6d('0x1d')](_0xdc6d('0x39'),auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x3a')]);router[_0xdc6d('0x1d')](_0xdc6d('0x1c'),auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x3b')]);router[_0xdc6d('0x3c')]('/:id',auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x3d')]);router[_0xdc6d('0x3e')]('/:id',auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x3f')]);router[_0xdc6d('0x3e')](_0xdc6d('0xa'),auth['isAuthenticated'](),controller[_0xdc6d('0x40')]);router['delete'](_0xdc6d('0xb'),auth[_0xdc6d('0x8')](),controller['removeAnswers']);router[_0xdc6d('0x3e')](_0xdc6d('0x1c'),auth[_0xdc6d('0x8')](),controller[_0xdc6d('0x41')]);module[_0xdc6d('0x42')]=router;
\ No newline at end of file
+var _0xc005=['/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/users','post','addDisposition','diskStorage','join','root','server/files/images/logos/','format','originalname','single','file','addLogo','%s-%s','now','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions'];(function(_0x318605,_0x393b5a){var _0x57664b=function(_0x3c8a16){while(--_0x3c8a16){_0x318605['push'](_0x318605['shift']());}};_0x57664b(++_0x393b5a);}(_0xc005,0x1dc));var _0x5c00=function(_0x5d5bcb,_0x25e2ea){_0x5d5bcb=_0x5d5bcb-0x0;var _0x4ea5eb=_0xc005[_0x5d5bcb];return _0x4ea5eb;};'use strict';var multer=require(_0x5c00('0x0'));var util=require(_0x5c00('0x1'));var path=require('path');var timeout=require(_0x5c00('0x2'));var express=require(_0x5c00('0x3'));var router=express[_0x5c00('0x4')]();var fs_extra=require(_0x5c00('0x5'));var auth=require(_0x5c00('0x6'));var interaction=require(_0x5c00('0x7'));var config=require(_0x5c00('0x8'));var controller=require(_0x5c00('0x9'));router[_0x5c00('0xa')]('/',auth[_0x5c00('0xb')](),controller[_0x5c00('0xc')]);router[_0x5c00('0xa')](_0x5c00('0xd'),auth['isAuthenticated'](),controller[_0x5c00('0xe')]);router[_0x5c00('0xa')](_0x5c00('0xf'),auth[_0x5c00('0xb')](),controller[_0x5c00('0x10')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5c00('0x11')]);router[_0x5c00('0xa')](_0x5c00('0x12'),auth[_0x5c00('0xb')](),controller[_0x5c00('0x13')]);router[_0x5c00('0xa')](_0x5c00('0x14'),controller[_0x5c00('0x15')]);router[_0x5c00('0xa')](_0x5c00('0x16'),controller[_0x5c00('0x17')]);router[_0x5c00('0xa')](_0x5c00('0x18'),controller[_0x5c00('0x19')]);router[_0x5c00('0xa')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x5c00('0xa')](_0x5c00('0x1a'),auth['isAuthenticated'](),controller[_0x5c00('0x1b')]);router[_0x5c00('0xa')](_0x5c00('0x1c'),controller[_0x5c00('0x1d')]);router[_0x5c00('0xa')](_0x5c00('0x1e'),auth[_0x5c00('0xb')](),controller[_0x5c00('0x1f')]);router[_0x5c00('0xa')](_0x5c00('0x20'),auth['isAuthenticated'](),controller[_0x5c00('0x21')]);router['get'](_0x5c00('0x22'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0x5c00('0xb')](),controller['getOfflineMessages']);router[_0x5c00('0xa')](_0x5c00('0x23'),auth['isAuthenticated'](),controller['getAgents']);router[_0x5c00('0x24')]('/',auth[_0x5c00('0xb')](),controller['create']);router[_0x5c00('0x24')]('/:id/dispositions',auth[_0x5c00('0xb')](),controller[_0x5c00('0x25')]);router[_0x5c00('0x24')]('/:id/canned_answers',auth[_0x5c00('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x5c00('0x26')]({'destination':function(_0x43d082,_0x478b4c,_0x464e22){_0x464e22(null,path[_0x5c00('0x27')](config[_0x5c00('0x28')],_0x5c00('0x29')));},'filename':function(_0x4610d8,_0x392a60,_0x3f0ea7){_0x3f0ea7(null,util[_0x5c00('0x2a')]('%s-%s',Date['now'](),_0x392a60[_0x5c00('0x2b')]));}})});router[_0x5c00('0x24')](_0x5c00('0x14'),upload[_0x5c00('0x2c')](_0x5c00('0x2d')),controller[_0x5c00('0x2e')]);var upload=multer({'storage':multer[_0x5c00('0x26')]({'destination':function(_0x48e53a,_0x4ada0e,_0x38d2d6){_0x38d2d6(null,path[_0x5c00('0x27')](config[_0x5c00('0x28')],'server/files/images/avatars/'));},'filename':function(_0x3708e6,_0x578539,_0x1c8ee5){_0x1c8ee5(null,util['format'](_0x5c00('0x2f'),Date[_0x5c00('0x30')](),_0x578539[_0x5c00('0x2b')]));}})});router[_0x5c00('0x24')](_0x5c00('0x16'),upload[_0x5c00('0x2c')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x5c00('0x26')]({'destination':function(_0x11f54e,_0x5baa7d,_0x5a257d){_0x5a257d(null,path[_0x5c00('0x27')](config[_0x5c00('0x28')],_0x5c00('0x31')));},'filename':function(_0x5f2c29,_0x82814c,_0x15a91c){_0x15a91c(null,util[_0x5c00('0x2a')](_0x5c00('0x2f'),Date[_0x5c00('0x30')](),_0x82814c[_0x5c00('0x2b')]));}})});router[_0x5c00('0x24')](_0x5c00('0x18'),upload[_0x5c00('0x2c')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x5c00('0x26')]({'destination':function(_0x4f1c23,_0x2d7225,_0x50331e){_0x50331e(null,path[_0x5c00('0x27')](config['root'],_0x5c00('0x31')));},'filename':function(_0x248b7f,_0x4bf10d,_0x1da8ad){_0x1da8ad(null,util[_0x5c00('0x2a')]('%s-%s',Date['now'](),_0x4bf10d[_0x5c00('0x2b')]));}})});router[_0x5c00('0x24')]('/:id/system_avatar',upload[_0x5c00('0x2c')](_0x5c00('0x2d')),controller[_0x5c00('0x32')]);router[_0x5c00('0x24')](_0x5c00('0x33'),controller[_0x5c00('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x5c00('0x26')]({'destination':function(_0x2eda5d,_0x45aaa5,_0x230120){const _0x41e55a=path[_0x5c00('0x27')](config[_0x5c00('0x28')],_0x5c00('0x35'),_0x5c00('0x36'),_0x5c00('0x37'));fs_extra[_0x5c00('0x38')](_0x41e55a,function(){_0x230120(null,_0x41e55a);});},'filename':function(_0x23b302,_0x4d12ec,_0x3bfd2d){const _0x5e8090=_0x4d12ec['originalname'][_0x5c00('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1022f0=path[_0x5c00('0x3a')](_0x5e8090);const _0x13486b=Date[_0x5c00('0x30')]()+'-'+_0x5e8090[_0x5c00('0x39')](_0x1022f0,'')+_0x1022f0;_0x3bfd2d(null,_0x13486b);}})});router[_0x5c00('0x24')](_0x5c00('0x3b'),offlineUploadMulter[_0x5c00('0x3c')](),controller[_0x5c00('0x3d')]);router['post']('/:id/interactions',auth[_0x5c00('0xb')](),controller[_0x5c00('0x3e')]);router['post'](_0x5c00('0x1e'),auth[_0x5c00('0xb')](),controller['addApplications']);router[_0x5c00('0x24')](_0x5c00('0x20'),auth[_0x5c00('0xb')](),controller[_0x5c00('0x3f')]);router['post'](_0x5c00('0x23'),auth[_0x5c00('0xb')](),controller[_0x5c00('0x40')]);router['put']('/:id',auth[_0x5c00('0xb')](),controller[_0x5c00('0x41')]);router['delete'](_0x5c00('0xf'),auth[_0x5c00('0xb')](),controller[_0x5c00('0x42')]);router[_0x5c00('0x43')]('/:id/dispositions',auth[_0x5c00('0xb')](),controller[_0x5c00('0x44')]);router[_0x5c00('0x43')](_0x5c00('0x12'),auth['isAuthenticated'](),controller[_0x5c00('0x45')]);router[_0x5c00('0x43')](_0x5c00('0x23'),auth[_0x5c00('0xb')](),controller[_0x5c00('0x46')]);module[_0x5c00('0x47')]=router;
\ No newline at end of file