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