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