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