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