3f291f902475195464340f20a7d06faa84d7196d
[motion2.git] / server / api / chatWebsite / index.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 _0xbb29=['delete','removeAnswers','removeAgents','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','single','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addSystemAvatar','/:id/notify','/:id/offline','addInteraction','addApplications','addProactiveActions','/:id/users','put','/:id','update','destroy'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xbb29,0x1bd));var _0x9bb2=function(_0xc68d79,_0x207ce0){_0xc68d79=_0xc68d79-0x0;var _0x323584=_0xbb29[_0xc68d79];return _0x323584;};'use strict';var multer=require(_0x9bb2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9bb2('0x1'));var express=require(_0x9bb2('0x2'));var router=express['Router']();var auth=require(_0x9bb2('0x3'));var interaction=require(_0x9bb2('0x4'));var config=require(_0x9bb2('0x5'));var controller=require(_0x9bb2('0x6'));router[_0x9bb2('0x7')]('/',auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9bb2('0xa')]);router[_0x9bb2('0x7')]('/:id',auth[_0x9bb2('0x8')](),controller[_0x9bb2('0xb')]);router[_0x9bb2('0x7')](_0x9bb2('0xc'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0xd')]);router[_0x9bb2('0x7')](_0x9bb2('0xe'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0xf')]);router[_0x9bb2('0x7')](_0x9bb2('0x10'),controller[_0x9bb2('0x11')]);router[_0x9bb2('0x7')](_0x9bb2('0x12'),controller[_0x9bb2('0x13')]);router['get']('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x9bb2('0x7')](_0x9bb2('0x14'),controller[_0x9bb2('0x15')]);router[_0x9bb2('0x7')](_0x9bb2('0x16'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x17')]);router[_0x9bb2('0x7')](_0x9bb2('0x18'),controller[_0x9bb2('0x19')]);router['get'](_0x9bb2('0x1a'),auth[_0x9bb2('0x8')](),controller['getApplications']);router['get'](_0x9bb2('0x1b'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x1c')]);router[_0x9bb2('0x7')](_0x9bb2('0x1d'),controller[_0x9bb2('0x1e')]);router[_0x9bb2('0x7')]('/:id/offline_messages',auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x1f')]);router[_0x9bb2('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x9bb2('0x20')]);router[_0x9bb2('0x21')]('/',auth[_0x9bb2('0x8')](),controller['create']);router['post']('/:id/dispositions',auth[_0x9bb2('0x8')](),controller['addDisposition']);router[_0x9bb2('0x21')](_0x9bb2('0xe'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x22')]);var upload=multer({'storage':multer[_0x9bb2('0x23')]({'destination':function(_0xe8af19,_0x2c7050,_0x5520c2){_0x5520c2(null,path[_0x9bb2('0x24')](config[_0x9bb2('0x25')],_0x9bb2('0x26')));},'filename':function(_0x49fdea,_0x3f892e,_0x1a1721){_0x1a1721(null,util[_0x9bb2('0x27')](_0x9bb2('0x28'),Date[_0x9bb2('0x29')](),_0x3f892e[_0x9bb2('0x2a')]));}})});router[_0x9bb2('0x21')](_0x9bb2('0x10'),upload['single'](_0x9bb2('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x9bb2('0x23')]({'destination':function(_0x567b3a,_0x4236b3,_0x4c876b){_0x4c876b(null,path[_0x9bb2('0x24')](config[_0x9bb2('0x25')],'server/files/images/avatars/'));},'filename':function(_0x5eca56,_0x3357c0,_0x1fc33f){_0x1fc33f(null,util['format']('%s-%s',Date['now'](),_0x3357c0['originalname']));}})});router[_0x9bb2('0x21')](_0x9bb2('0x12'),upload[_0x9bb2('0x2c')](_0x9bb2('0x2b')),controller[_0x9bb2('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e46c3,_0x4583bf,_0x3b3ff9){_0x3b3ff9(null,path[_0x9bb2('0x24')](config[_0x9bb2('0x25')],_0x9bb2('0x2e')));},'filename':function(_0x8722ee,_0x521545,_0x4489dd){_0x4489dd(null,util[_0x9bb2('0x27')](_0x9bb2('0x28'),Date[_0x9bb2('0x29')](),_0x521545[_0x9bb2('0x2a')]));}})});router['post'](_0x9bb2('0x2f'),upload[_0x9bb2('0x2c')](_0x9bb2('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x9bb2('0x23')]({'destination':function(_0x3f69de,_0x2b5cca,_0x45aca4){_0x45aca4(null,path[_0x9bb2('0x24')](config[_0x9bb2('0x25')],_0x9bb2('0x2e')));},'filename':function(_0x30c31f,_0x3cfba5,_0x5e8c70){_0x5e8c70(null,util[_0x9bb2('0x27')](_0x9bb2('0x28'),Date['now'](),_0x3cfba5[_0x9bb2('0x2a')]));}})});router[_0x9bb2('0x21')]('/:id/system_avatar',upload['single'](_0x9bb2('0x2b')),controller[_0x9bb2('0x30')]);router[_0x9bb2('0x21')](_0x9bb2('0x31'),controller['notify']);router[_0x9bb2('0x21')](_0x9bb2('0x32'),controller['offline']);router[_0x9bb2('0x21')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x9bb2('0x33')]);router[_0x9bb2('0x21')](_0x9bb2('0x1a'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x34')]);router['post'](_0x9bb2('0x1b'),auth['isAuthenticated'](),controller[_0x9bb2('0x35')]);router[_0x9bb2('0x21')](_0x9bb2('0x36'),auth[_0x9bb2('0x8')](),controller['addAgents']);router[_0x9bb2('0x37')](_0x9bb2('0x38'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x39')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9bb2('0x3a')]);router[_0x9bb2('0x3b')](_0x9bb2('0xc'),auth[_0x9bb2('0x8')](),controller['removeDispositions']);router[_0x9bb2('0x3b')](_0x9bb2('0xe'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x3c')]);router['delete'](_0x9bb2('0x36'),auth[_0x9bb2('0x8')](),controller[_0x9bb2('0x3d')]);module[_0x9bb2('0x3e')]=router;