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