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