テスト環境デプロイ
This commit is contained in:
parent
bb072cc91c
commit
1259ba76c9
6 changed files with 267 additions and 30 deletions
|
|
@ -6,6 +6,7 @@ import { hubspotController } from "./logics/hubspot";
|
|||
import { createCustomError, responseError } from "./logics/error";
|
||||
import { CLOUD_STORAGE_LOG_FOLDER_NAME, CLOUD_STORAGE_MASTER_FOLDER_NAME, COMPANIES_FILE_NAME, OWNERS_FILE_NAME } from "../serverConfig";
|
||||
import { Delay } from "cerceis-lib";
|
||||
import { googleDriveController } from "./logics/googleDrive";
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
|
|
@ -13,6 +14,10 @@ const router = express.Router();
|
|||
router.post("/miitel", async (req, res) => {
|
||||
try {
|
||||
const body = req.body;
|
||||
|
||||
if('challenge' in body) return res.status(200).contentType('text/plain').send(body.challenge);
|
||||
|
||||
|
||||
const parsedBody = MiiTelWebhookSchema.safeParse(body);
|
||||
if (!parsedBody.success) throw createCustomError("ZOD_FAILED");
|
||||
|
||||
|
|
@ -23,9 +28,10 @@ router.post("/miitel", async (req, res) => {
|
|||
await processRequest(videoInfo);
|
||||
// if(!result) throw
|
||||
|
||||
res.status(200).send("ok");
|
||||
return res.status(200).send("ok");
|
||||
} catch(err) {
|
||||
responseError(err, res)
|
||||
responseError(err, res);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -118,22 +124,22 @@ router.post("/logUpload", async (req, res) => {
|
|||
// res.send('ok');
|
||||
// });
|
||||
|
||||
// router.post("/test", async (req, res) => {
|
||||
// try {
|
||||
router.post("/test", async (req, res) => {
|
||||
try {
|
||||
|
||||
// const googleAuth = await googleDriveController.getAuth();
|
||||
// const driveClilent = googleDriveController.getDriveClient(googleAuth);
|
||||
// const sheetsClient = googleDriveController.getSheetsClient(googleAuth);
|
||||
// const folderId = await googleDriveController.searchFileIdByFileName(driveClilent, MINUTES_CREATION_HISTORY_FOLDER_ID, '2025');
|
||||
// if(!folderId) throw new Error()
|
||||
// // console.log(fileId);
|
||||
// // const sheetId = await googleDriveController.getLogSheetId(driveClilent, sheetsClient, folderId, 'test1');
|
||||
// // console.log('sheet id : ', sheetId);
|
||||
// res.send("ok");
|
||||
// } catch (error) {
|
||||
// console.error("Error in /test endpoint:", error);
|
||||
// res.status(500).send("Error in /test endpoint");
|
||||
// }
|
||||
// });
|
||||
// const googleAuth = await googleDriveController.getAuth();
|
||||
// const driveClilent = googleDriveController.getDriveClient(googleAuth);
|
||||
// const sheetsClient = googleDriveController.getSheetsClient(googleAuth);
|
||||
// const folderId = await googleDriveController.searchFileIdByFileName(driveClilent, MINUTES_CREATION_HISTORY_FOLDER_ID, '2025');
|
||||
// if(!folderId) throw new Error()
|
||||
// console.log(fileId);
|
||||
// const sheetId = await googleDriveController.getLogSheetId(driveClilent, sheetsClient, folderId, 'test1');
|
||||
// console.log('sheet id : ', sheetId);
|
||||
res.send("ok");
|
||||
} catch (error) {
|
||||
console.error("Error in /test endpoint:", error);
|
||||
res.status(500).send("Error in /test endpoint");
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
Loading…
Add table
Add a link
Reference in a new issue