20251125 save
This commit is contained in:
parent
922fa0e77a
commit
092f2ec0f3
11 changed files with 299 additions and 1 deletions
57
functions/generate_minutes/src/logics/process.ts
Normal file
57
functions/generate_minutes/src/logics/process.ts
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
import z from "zod";
|
||||
import { aiController } from "./ai";
|
||||
import { dateController } from "./date";
|
||||
import { googleDriveController } from "./googleDrive";
|
||||
|
||||
const VideoInfoSchema = z.looseObject({
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
starts_at: z.string(),
|
||||
ends_at: z.string(),
|
||||
access_permission: z.string(),
|
||||
host: z.object({
|
||||
login_id: z.string(),
|
||||
user_name: z.string(),
|
||||
}),
|
||||
speech_recognition: z.object({
|
||||
raw: z.string(),
|
||||
})
|
||||
});
|
||||
|
||||
type VideoInfo = z.infer<typeof VideoInfoSchema>;
|
||||
|
||||
export const MiiTelWebhookSchema = z.object({
|
||||
video: VideoInfoSchema,
|
||||
});
|
||||
|
||||
// export type MiiTelWebhook = z.infer<typeof MiiTelWebhookSchema>;
|
||||
|
||||
export const processRequest = async(videoInfo: VideoInfo) => {
|
||||
const videoId = videoInfo.id;
|
||||
const title = videoInfo.title;
|
||||
const startsAt = videoInfo.starts_at;
|
||||
const endsAt = videoInfo.ends_at;
|
||||
const accessPermission = videoInfo.access_permission;
|
||||
|
||||
const host_id = videoInfo.host.login_id;
|
||||
const host_name = videoInfo.host.user_name;
|
||||
|
||||
const speechRecognition = videoInfo.speech_recognition.raw;
|
||||
|
||||
console.log(startsAt);
|
||||
const jstStartsAt = dateController.convertToJst(startsAt);
|
||||
const jstEndsAt = dateController.convertToJst(endsAt);
|
||||
|
||||
googleDriveController.checkConnection();
|
||||
// console.log(dateController.getFormattedDate(startsAtJst, "yyyy/MM/dd hh:mm:ss"));
|
||||
// console.log(endsAt);
|
||||
// console.log("Processing video:", host_id, host_name, title);
|
||||
if(accessPermission !== "EVERYONE" || !title.includes("様") || title.includes("社内")) return;
|
||||
|
||||
|
||||
|
||||
// Save Request Log to Google Drive
|
||||
// const minute = await aiController.generateMinutes(speechRecognition);
|
||||
// console.log(minute);
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue