File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { NextResponse } from "next/server" ;
22import { start } from "workflow/api" ;
3+ import { mainConfig } from "@/lib/config" ;
34import { syncLumaEventsWorkflow } from "@/workflows/luma-sync" ;
45
56export const runtime = "nodejs" ;
@@ -30,9 +31,9 @@ export async function GET(request: Request) {
3031 }
3132
3233 try {
33- const calendarApiId = process . env . LUMA_CALENDAR_API_ID ;
34+ const calendarApiId = mainConfig . luma . calendarApiId ;
3435 const calendarHandle =
35- process . env . LUMA_CALENDAR_HANDLE ?? DEFAULT_CALENDAR_HANDLE ;
36+ mainConfig . luma . calendarHandle ?? DEFAULT_CALENDAR_HANDLE ;
3637
3738 const run = await start ( syncLumaEventsWorkflow , [
3839 {
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ export const mainConfig = {
1818 } ,
1919 luma : {
2020 apiKey : integrationsConfig . lumaApiKey ,
21+ calendarApiId : integrationsConfig . lumaCalendarApiId ,
22+ calendarHandle : integrationsConfig . lumaCalendarHandle ,
2123 } ,
2224 discord : {
2325 botToken : integrationsConfig . discordBotToken ,
Original file line number Diff line number Diff line change @@ -9,6 +9,14 @@ const integrationsEnvConfig = configSchema("Integrations", {
99 env : "LUMA_API_KEY" ,
1010 optional : true ,
1111 } ) ,
12+ lumaCalendarApiId : server ( {
13+ env : "LUMA_CALENDAR_API_ID" ,
14+ optional : true ,
15+ } ) ,
16+ lumaCalendarHandle : server ( {
17+ env : "LUMA_CALENDAR_HANDLE" ,
18+ optional : true ,
19+ } ) ,
1220 discordBotToken : server ( {
1321 env : "DISCORD_BOT_TOKEN" ,
1422 optional : true ,
@@ -22,6 +30,8 @@ const integrationsEnvConfig = configSchema("Integrations", {
2230export const integrationsConfig = {
2331 resendApiKey : integrationsEnvConfig . server . resendApiKey ,
2432 lumaApiKey : integrationsEnvConfig . server . lumaApiKey ,
33+ lumaCalendarApiId : integrationsEnvConfig . server . lumaCalendarApiId ,
34+ lumaCalendarHandle : integrationsEnvConfig . server . lumaCalendarHandle ,
2535 discordBotToken : integrationsEnvConfig . server . discordBotToken ,
2636 discordReviewChannelId : integrationsEnvConfig . server . discordReviewChannelId ,
2737} ;
You can’t perform that action at this time.
0 commit comments