feat: google sheets(#579)

---------

Co-authored-by: Carlos Valente <carlosvalente@pm.me>
This commit is contained in:
Alex Christoffer Rasmussen
2024-01-08 15:51:58 +01:00
committed by GitHub
parent 068ec800f4
commit c0fb865959
18 changed files with 2189 additions and 131 deletions
+30
View File
@@ -21,6 +21,13 @@ import {
postViewSettings,
previewExcel,
postHTTP,
getAuthenticationUrl,
uploadSheetClientFile as uploadClientSecret,
pullSheet,
pushSheet,
postId,
getAuthentication,
getClientSecrect as getClientSecret,
} from '../controllers/ontimeController.js';
import {
@@ -32,6 +39,9 @@ import {
viewValidator,
validateHTTP,
validateOscSubscription,
validateSheetid,
validateWorksheet,
validateSheetOptions,
} from '../controllers/ontimeController.validate.js';
import { projectSanitiser } from '../controllers/projectController.validate.js';
@@ -96,3 +106,23 @@ router.post('/http', validateHTTP, postHTTP);
// create route between controller and '/ontime/new' endpoint
router.post('/new', projectSanitiser, postNew);
//SETP-1
router.post('/sheet/clientsecret', uploadFile, uploadClientSecret);
router.get('/sheet/clientsecret', uploadFile, getClientSecret);
//SETP-2
router.get('/sheet/authentication/url', getAuthenticationUrl);
router.get('/sheet/authentication', getAuthentication);
//STEP-3
router.post('/sheet/id', validateSheetid, postId);
//STEP-4
router.post('/sheet/worksheet', validateWorksheet, postId);
//STEP-5 download and generate preview
router.post('/sheet/pull', validateSheetOptions, pullSheet);
//STEP-5 upload
router.post('/sheet-push', validateSheetOptions, pushSheet);