Built motion from commit e781dc3c.|2.5.42
[motion2.git] / server / api / chatWebsite / index.js
index 4c83b95..b67c396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54f0=['single','root','server/files/images/avatars/','format','/:id/avatar','file','addAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','any','offline','addApplications','addProactiveActions','/:id/users','addAgents','update','delete','/:id','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','%s-%s','now','originalname','/:id/logo'];(function(_0x2ef6e0,_0x24707b){var _0x5e3bf7=function(_0x2a13ba){while(--_0x2a13ba){_0x2ef6e0['push'](_0x2ef6e0['shift']());}};_0x5e3bf7(++_0x24707b);}(_0x54f0,0x141));var _0x054f=function(_0x55e088,_0x334a90){_0x55e088=_0x55e088-0x0;var _0x3065d4=_0x54f0[_0x55e088];return _0x3065d4;};'use strict';var multer=require(_0x054f('0x0'));var util=require(_0x054f('0x1'));var path=require(_0x054f('0x2'));var timeout=require(_0x054f('0x3'));var express=require(_0x054f('0x4'));var router=express[_0x054f('0x5')]();var fs_extra=require(_0x054f('0x6'));var auth=require(_0x054f('0x7'));var interaction=require(_0x054f('0x8'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x054f('0x9')](),controller['index']);router['get'](_0x054f('0xa'),auth['isAuthenticated'](),controller[_0x054f('0xb')]);router[_0x054f('0xc')]('/:id',auth[_0x054f('0x9')](),controller[_0x054f('0xd')]);router[_0x054f('0xc')](_0x054f('0xe'),auth[_0x054f('0x9')](),controller[_0x054f('0xf')]);router['get'](_0x054f('0x10'),auth[_0x054f('0x9')](),controller[_0x054f('0x11')]);router[_0x054f('0xc')]('/:id/logo',controller['getLogo']);router[_0x054f('0xc')]('/:id/avatar',controller[_0x054f('0x12')]);router[_0x054f('0xc')](_0x054f('0x13'),controller[_0x054f('0x14')]);router[_0x054f('0xc')]('/:id/system_avatar',controller[_0x054f('0x15')]);router[_0x054f('0xc')](_0x054f('0x16'),auth[_0x054f('0x9')](),controller[_0x054f('0x17')]);router[_0x054f('0xc')](_0x054f('0x18'),controller[_0x054f('0x19')]);router[_0x054f('0xc')](_0x054f('0x1a'),auth[_0x054f('0x9')](),controller[_0x054f('0x1b')]);router['get'](_0x054f('0x1c'),auth[_0x054f('0x9')](),controller[_0x054f('0x1d')]);router['get']('/:id/fields',controller[_0x054f('0x1e')]);router[_0x054f('0xc')](_0x054f('0x1f'),auth[_0x054f('0x9')](),controller[_0x054f('0x20')]);router[_0x054f('0xc')]('/:id/users',auth[_0x054f('0x9')](),controller[_0x054f('0x21')]);router[_0x054f('0x22')]('/',auth[_0x054f('0x9')](),controller[_0x054f('0x23')]);router['post'](_0x054f('0xe'),auth[_0x054f('0x9')](),controller[_0x054f('0x24')]);router[_0x054f('0x22')](_0x054f('0x10'),auth[_0x054f('0x9')](),controller[_0x054f('0x25')]);var upload=multer({'storage':multer[_0x054f('0x26')]({'destination':function(_0x5c02d8,_0x428719,_0x58100d){_0x58100d(null,path[_0x054f('0x27')](config['root'],'server/files/images/logos/'));},'filename':function(_0x360512,_0x553e60,_0x47a181){_0x47a181(null,util['format'](_0x054f('0x28'),Date[_0x054f('0x29')](),_0x553e60[_0x054f('0x2a')]));}})});router['post'](_0x054f('0x2b'),upload[_0x054f('0x2c')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x054f('0x26')]({'destination':function(_0xd3cb6b,_0x10fcdc,_0x30e709){_0x30e709(null,path[_0x054f('0x27')](config[_0x054f('0x2d')],_0x054f('0x2e')));},'filename':function(_0x320593,_0x3735f4,_0x40f5b6){_0x40f5b6(null,util[_0x054f('0x2f')](_0x054f('0x28'),Date['now'](),_0x3735f4[_0x054f('0x2a')]));}})});router[_0x054f('0x22')](_0x054f('0x30'),upload[_0x054f('0x2c')](_0x054f('0x31')),controller[_0x054f('0x32')]);var upload=multer({'storage':multer[_0x054f('0x26')]({'destination':function(_0x3d79e1,_0xa653fe,_0x2780a2){_0x2780a2(null,path[_0x054f('0x27')](config[_0x054f('0x2d')],'server/files/images/avatars/'));},'filename':function(_0x4e29be,_0x281f4d,_0x2448a4){_0x2448a4(null,util[_0x054f('0x2f')]('%s-%s',Date[_0x054f('0x29')](),_0x281f4d[_0x054f('0x2a')]));}})});router[_0x054f('0x22')](_0x054f('0x13'),upload[_0x054f('0x2c')](_0x054f('0x31')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x054f('0x26')]({'destination':function(_0x11eef0,_0x54aaaa,_0x4035f3){_0x4035f3(null,path[_0x054f('0x27')](config[_0x054f('0x2d')],'server/files/images/avatars/'));},'filename':function(_0x319c9f,_0xec0ab5,_0x57491b){_0x57491b(null,util[_0x054f('0x2f')]('%s-%s',Date[_0x054f('0x29')](),_0xec0ab5[_0x054f('0x2a')]));}})});router[_0x054f('0x22')](_0x054f('0x33'),upload['single']('file'),controller[_0x054f('0x34')]);router[_0x054f('0x22')](_0x054f('0x35'),controller[_0x054f('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x054f('0x26')]({'destination':function(_0x5ac7c7,_0x4bb9a3,_0x46bb23){const _0x3edb02=path[_0x054f('0x27')](config[_0x054f('0x2d')],_0x054f('0x37'),_0x054f('0x38'),_0x054f('0x39'));fs_extra[_0x054f('0x3a')](_0x3edb02,function(){_0x46bb23(null,_0x3edb02);});},'filename':function(_0x4d2992,_0x1a172c,_0x2125e0){const _0x417c6e=_0x1a172c[_0x054f('0x2a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x400642=path['extname'](_0x417c6e);const _0xb4e2d8=Date[_0x054f('0x29')]()+'-'+_0x417c6e[_0x054f('0x3b')](_0x400642,'')+_0x400642;_0x2125e0(null,_0xb4e2d8);}})});router[_0x054f('0x22')]('/:id/offline',offlineUploadMulter[_0x054f('0x3c')](),controller[_0x054f('0x3d')]);router[_0x054f('0x22')](_0x054f('0x16'),auth[_0x054f('0x9')](),controller['addInteraction']);router[_0x054f('0x22')](_0x054f('0x1a'),auth[_0x054f('0x9')](),controller[_0x054f('0x3e')]);router[_0x054f('0x22')](_0x054f('0x1c'),auth['isAuthenticated'](),controller[_0x054f('0x3f')]);router[_0x054f('0x22')](_0x054f('0x40'),auth[_0x054f('0x9')](),controller[_0x054f('0x41')]);router['put']('/:id',auth[_0x054f('0x9')](),controller[_0x054f('0x42')]);router[_0x054f('0x43')](_0x054f('0x44'),auth[_0x054f('0x9')](),controller['destroy']);router[_0x054f('0x43')](_0x054f('0xe'),auth[_0x054f('0x9')](),controller[_0x054f('0x45')]);router[_0x054f('0x43')](_0x054f('0x10'),auth[_0x054f('0x9')](),controller[_0x054f('0x46')]);router['delete']('/:id/users',auth[_0x054f('0x9')](),controller[_0x054f('0x47')]);module[_0x054f('0x48')]=router;
\ No newline at end of file
+var _0x4b04=['post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','root','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addApplications','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/users','getAgents'];(function(_0x46428c,_0x20ab75){var _0x16a677=function(_0x2b0817){while(--_0x2b0817){_0x46428c['push'](_0x46428c['shift']());}};_0x16a677(++_0x20ab75);}(_0x4b04,0xf1));var _0x44b0=function(_0x17f9fe,_0x4a6e75){_0x17f9fe=_0x17f9fe-0x0;var _0x2ceced=_0x4b04[_0x17f9fe];return _0x2ceced;};'use strict';var multer=require(_0x44b0('0x0'));var util=require(_0x44b0('0x1'));var path=require('path');var timeout=require(_0x44b0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x44b0('0x3'));var config=require(_0x44b0('0x4'));var controller=require(_0x44b0('0x5'));router['get']('/',auth[_0x44b0('0x6')](),controller[_0x44b0('0x7')]);router[_0x44b0('0x8')](_0x44b0('0x9'),auth[_0x44b0('0x6')](),controller[_0x44b0('0xa')]);router[_0x44b0('0x8')](_0x44b0('0xb'),auth['isAuthenticated'](),controller[_0x44b0('0xc')]);router[_0x44b0('0x8')]('/:id/dispositions',auth[_0x44b0('0x6')](),controller['getDispositions']);router[_0x44b0('0x8')](_0x44b0('0xd'),auth[_0x44b0('0x6')](),controller['getAnswers']);router['get'](_0x44b0('0xe'),controller[_0x44b0('0xf')]);router['get'](_0x44b0('0x10'),controller[_0x44b0('0x11')]);router[_0x44b0('0x8')]('/:id/customer_avatar',controller[_0x44b0('0x12')]);router['get'](_0x44b0('0x13'),controller[_0x44b0('0x14')]);router[_0x44b0('0x8')](_0x44b0('0x15'),auth[_0x44b0('0x6')](),controller['getInteractions']);router[_0x44b0('0x8')](_0x44b0('0x16'),controller[_0x44b0('0x17')]);router[_0x44b0('0x8')](_0x44b0('0x18'),auth[_0x44b0('0x6')](),controller[_0x44b0('0x19')]);router[_0x44b0('0x8')](_0x44b0('0x1a'),auth[_0x44b0('0x6')](),controller['getProactiveActions']);router[_0x44b0('0x8')](_0x44b0('0x1b'),controller[_0x44b0('0x1c')]);router[_0x44b0('0x8')]('/:id/offline_messages',auth[_0x44b0('0x6')](),controller['getOfflineMessages']);router[_0x44b0('0x8')](_0x44b0('0x1d'),auth['isAuthenticated'](),controller[_0x44b0('0x1e')]);router[_0x44b0('0x1f')]('/',auth[_0x44b0('0x6')](),controller[_0x44b0('0x20')]);router[_0x44b0('0x1f')]('/:id/dispositions',auth[_0x44b0('0x6')](),controller[_0x44b0('0x21')]);router[_0x44b0('0x1f')](_0x44b0('0xd'),auth['isAuthenticated'](),controller[_0x44b0('0x22')]);var upload=multer({'storage':multer[_0x44b0('0x23')]({'destination':function(_0x3197fb,_0x485d8d,_0x7e8f6c){_0x7e8f6c(null,path[_0x44b0('0x24')](config['root'],_0x44b0('0x25')));},'filename':function(_0x14bcc9,_0x3da609,_0x207d14){_0x207d14(null,util[_0x44b0('0x26')](_0x44b0('0x27'),Date[_0x44b0('0x28')](),_0x3da609[_0x44b0('0x29')]));}})});router[_0x44b0('0x1f')](_0x44b0('0xe'),upload[_0x44b0('0x2a')](_0x44b0('0x2b')),controller[_0x44b0('0x2c')]);var upload=multer({'storage':multer[_0x44b0('0x23')]({'destination':function(_0x260e9a,_0x28248e,_0xc055e3){_0xc055e3(null,path[_0x44b0('0x24')](config[_0x44b0('0x2d')],_0x44b0('0x2e')));},'filename':function(_0x302dc4,_0x1a7a10,_0x53840c){_0x53840c(null,util[_0x44b0('0x26')]('%s-%s',Date['now'](),_0x1a7a10['originalname']));}})});router[_0x44b0('0x1f')](_0x44b0('0x10'),upload['single'](_0x44b0('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe41b03,_0x4ac1ae,_0x113f47){_0x113f47(null,path[_0x44b0('0x24')](config[_0x44b0('0x2d')],_0x44b0('0x2e')));},'filename':function(_0x56bfe9,_0x3c4aa1,_0x47d15d){_0x47d15d(null,util[_0x44b0('0x26')](_0x44b0('0x27'),Date[_0x44b0('0x28')](),_0x3c4aa1[_0x44b0('0x29')]));}})});router[_0x44b0('0x1f')](_0x44b0('0x2f'),upload[_0x44b0('0x2a')](_0x44b0('0x2b')),controller[_0x44b0('0x30')]);var upload=multer({'storage':multer[_0x44b0('0x23')]({'destination':function(_0x4c5256,_0x4cc819,_0x12ec26){_0x12ec26(null,path[_0x44b0('0x24')](config[_0x44b0('0x2d')],_0x44b0('0x2e')));},'filename':function(_0x33dcf8,_0x669377,_0x212777){_0x212777(null,util['format'](_0x44b0('0x27'),Date[_0x44b0('0x28')](),_0x669377[_0x44b0('0x29')]));}})});router['post']('/:id/system_avatar',upload[_0x44b0('0x2a')](_0x44b0('0x2b')),controller[_0x44b0('0x31')]);router[_0x44b0('0x1f')](_0x44b0('0x32'),controller[_0x44b0('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x44b0('0x23')]({'destination':function(_0x551e2a,_0x2c761f,_0x21c7fd){const _0x22e19e=path[_0x44b0('0x24')](config[_0x44b0('0x2d')],_0x44b0('0x34'),_0x44b0('0x35'),_0x44b0('0x36'));fs_extra[_0x44b0('0x37')](_0x22e19e,function(){_0x21c7fd(null,_0x22e19e);});},'filename':function(_0x5458b8,_0x44fa09,_0x4b9c0b){const _0x313f19=_0x44fa09[_0x44b0('0x29')][_0x44b0('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x284782=path[_0x44b0('0x39')](_0x313f19);const _0x3a9377=Date[_0x44b0('0x28')]()+'-'+_0x313f19[_0x44b0('0x38')](_0x284782,'')+_0x284782;_0x4b9c0b(null,_0x3a9377);}})});router[_0x44b0('0x1f')](_0x44b0('0x3a'),offlineUploadMulter['any'](),controller[_0x44b0('0x3b')]);router[_0x44b0('0x1f')](_0x44b0('0x15'),auth[_0x44b0('0x6')](),controller['addInteraction']);router[_0x44b0('0x1f')]('/:id/applications',auth['isAuthenticated'](),controller[_0x44b0('0x3c')]);router['post'](_0x44b0('0x1a'),auth[_0x44b0('0x6')](),controller['addProactiveActions']);router[_0x44b0('0x1f')](_0x44b0('0x1d'),auth[_0x44b0('0x6')](),controller['addAgents']);router['put'](_0x44b0('0xb'),auth[_0x44b0('0x6')](),controller['update']);router[_0x44b0('0x3d')]('/:id',auth[_0x44b0('0x6')](),controller[_0x44b0('0x3e')]);router['delete'](_0x44b0('0x3f'),auth[_0x44b0('0x6')](),controller[_0x44b0('0x40')]);router['delete'](_0x44b0('0xd'),auth[_0x44b0('0x6')](),controller[_0x44b0('0x41')]);router['delete'](_0x44b0('0x1d'),auth[_0x44b0('0x6')](),controller[_0x44b0('0x42')]);module[_0x44b0('0x43')]=router;
\ No newline at end of file