0278e992b6decb1d5f783854369da5c7d5fa2c62
[motion2.git] / server / api / user / 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 _0xbe0f=['format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','express','../../components/auth/service','../../config/environment','./user.controller','get','index','isAuthenticated','describe','/:id','/:id/avatar','getAvatar','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/agents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/create_many','bulkCreate','addContacts','create','diskStorage','join','root','server/files/images/'];(function(_0x50ce0c,_0x541b68){var _0x3c988c=function(_0x1684ee){while(--_0x1684ee){_0x50ce0c['push'](_0x50ce0c['shift']());}};_0x3c988c(++_0x541b68);}(_0xbe0f,0x1d3));var _0xfbe0=function(_0x2a3da5,_0x4e8280){_0x2a3da5=_0x2a3da5-0x0;var _0x4a11c6=_0xbe0f[_0x2a3da5];return _0x4a11c6;};'use strict';var multer=require(_0xfbe0('0x0'));var util=require(_0xfbe0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfbe0('0x2'));var router=express['Router']();var auth=require(_0xfbe0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfbe0('0x4'));var controller=require(_0xfbe0('0x5'));router[_0xfbe0('0x6')]('/',auth['isAuthenticated'](),controller[_0xfbe0('0x7')]);router[_0xfbe0('0x6')]('/describe',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x9')]);router[_0xfbe0('0x6')](_0xfbe0('0xa'),auth[_0xfbe0('0x8')](),controller['show']);router[_0xfbe0('0x6')](_0xfbe0('0xb'),controller[_0xfbe0('0xc')]);router[_0xfbe0('0x6')]('/:id/contacts',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0xd')]);router[_0xfbe0('0x6')](_0xfbe0('0xe'),auth[_0xfbe0('0x8')](),controller['getQueues']);router[_0xfbe0('0x6')](_0xfbe0('0xf'),auth['isAuthenticated'](),controller[_0xfbe0('0x10')]);router[_0xfbe0('0x6')](_0xfbe0('0x11'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x12')]);router[_0xfbe0('0x6')](_0xfbe0('0x13'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x14')]);router[_0xfbe0('0x6')](_0xfbe0('0x15'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x16')]);router[_0xfbe0('0x6')](_0xfbe0('0x17'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x18')]);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0xfbe0('0x19')]);router[_0xfbe0('0x6')](_0xfbe0('0x1a'),auth['isAuthenticated'](),controller[_0xfbe0('0x1b')]);router[_0xfbe0('0x6')]('/:id/sms/interactions',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x1c')]);router[_0xfbe0('0x6')](_0xfbe0('0x1d'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x1e')]);router[_0xfbe0('0x6')](_0xfbe0('0x1f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x20')]);router[_0xfbe0('0x6')]('/:id/lists',auth[_0xfbe0('0x8')](),controller['getLists']);router[_0xfbe0('0x6')](_0xfbe0('0x21'),auth[_0xfbe0('0x8')](),controller['getAgents']);router[_0xfbe0('0x6')]('/:id/prefixes',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x22')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xfbe0('0x23')]);router[_0xfbe0('0x6')](_0xfbe0('0x24'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x25')]);router['get'](_0xfbe0('0x26'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x27')]);router[_0xfbe0('0x6')](_0xfbe0('0x28'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x29')]);router[_0xfbe0('0x6')](_0xfbe0('0x2a'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x2b')]);router[_0xfbe0('0x6')](_0xfbe0('0x2c'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x2d')]);router[_0xfbe0('0x6')](_0xfbe0('0x2e'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x2f')]);router[_0xfbe0('0x6')](_0xfbe0('0x30'),auth[_0xfbe0('0x8')](),controller['getApiKey']);router[_0xfbe0('0x31')](_0xfbe0('0x32'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x33')]);router[_0xfbe0('0x31')]('/:id/contacts',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x34')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfbe0('0x35')]);router[_0xfbe0('0x31')](_0xfbe0('0xe'),auth[_0xfbe0('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0xfbe0('0x36')]({'destination':function(_0x2fcc2d,_0x403851,_0x1b6bc9){_0x1b6bc9(null,path[_0xfbe0('0x37')](config[_0xfbe0('0x38')],_0xfbe0('0x39')));},'filename':function(_0x3dd806,_0x46b8c2,_0x2a89bc){_0x2a89bc(null,util[_0xfbe0('0x3a')](_0xfbe0('0x3b'),Date[_0xfbe0('0x3c')](),_0x46b8c2[_0xfbe0('0x3d')]));}})});router['post'](_0xfbe0('0xb'),upload[_0xfbe0('0x3e')](_0xfbe0('0x3f')),controller[_0xfbe0('0x40')]);router[_0xfbe0('0x31')](_0xfbe0('0x41'),auth['isAuthenticated'](),controller['login']);router[_0xfbe0('0x31')](_0xfbe0('0x42'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x43')]);router[_0xfbe0('0x31')](_0xfbe0('0x44'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x45')]);router[_0xfbe0('0x31')](_0xfbe0('0x46'),auth['isAuthenticated'](),controller[_0xfbe0('0x47')]);router[_0xfbe0('0x31')](_0xfbe0('0x1f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x48')]);router['post'](_0xfbe0('0x49'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x4a')]);router[_0xfbe0('0x31')](_0xfbe0('0x4b'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x4c')]);router[_0xfbe0('0x31')]('/:id/fax_interactions',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x4d')]);router[_0xfbe0('0x31')]('/:id/sms_interactions',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x4e')]);router[_0xfbe0('0x31')](_0xfbe0('0x4f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x50')]);router[_0xfbe0('0x31')]('/:id/fax_accounts',auth[_0xfbe0('0x8')](),controller['addFaxAccounts']);router[_0xfbe0('0x31')]('/:id/mail_accounts',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x51')]);router['post'](_0xfbe0('0x26'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x52')]);router[_0xfbe0('0x31')]('/:id/sms_accounts',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x53')]);router[_0xfbe0('0x31')](_0xfbe0('0x2a'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x54')]);router[_0xfbe0('0x31')](_0xfbe0('0x2c'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x55')]);router['post'](_0xfbe0('0x30'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x56')]);router[_0xfbe0('0x57')]('/:id',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x58')]);router[_0xfbe0('0x57')]('/:id/password',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x59')]);router[_0xfbe0('0x5a')]('/:id/queues',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x5b')]);router['delete'](_0xfbe0('0x1f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x5c')]);router[_0xfbe0('0x5a')](_0xfbe0('0xa'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x5d')]);router[_0xfbe0('0x5a')](_0xfbe0('0x49'),auth['isAuthenticated'](),controller[_0xfbe0('0x5e')]);router[_0xfbe0('0x5a')](_0xfbe0('0x4b'),auth[_0xfbe0('0x8')](),controller['removeMailInteractions']);router[_0xfbe0('0x5a')](_0xfbe0('0x5f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x60')]);router['delete'](_0xfbe0('0x61'),auth[_0xfbe0('0x8')](),controller['removeSmsInteractions']);router[_0xfbe0('0x5a')](_0xfbe0('0x4f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x62')]);router[_0xfbe0('0x5a')](_0xfbe0('0x63'),auth['isAuthenticated'](),controller[_0xfbe0('0x64')]);router['delete'](_0xfbe0('0x24'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x65')]);router[_0xfbe0('0x5a')]('/:id/openchannel_accounts',auth[_0xfbe0('0x8')](),controller['removeOpenchannelAccounts']);router[_0xfbe0('0x5a')](_0xfbe0('0x28'),auth[_0xfbe0('0x8')](),controller['removeSmsAccounts']);router[_0xfbe0('0x5a')](_0xfbe0('0x2a'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x66')]);router[_0xfbe0('0x5a')](_0xfbe0('0x2c'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x67')]);router[_0xfbe0('0x5a')]('/:id/api_key',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x68')]);module['exports']=router;