[CAL-770] add new integration architecture revamp (#1369)
* [CAL-770] add new integration architecture revamp * Type fixes * Type fixes * [CAL-770] Remove tsconfig.tsbuildinfo * [CAL-770] add integration test * Improve google calendar test integration * Remove console.log * Change response any to void in the deleteEvent method * Remove unnecesary const * Add tsconfig.tsbuildinfo to the .gitignore * Remove process env variables as const Co-authored-by: Edward Fernández <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: zomars <[email protected]> Co-authored-by: Edward Fernandez <[email protected]>
This commit is contained in:
48 files changed
+1098
-945
No files matched your search
@@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import { getSession } from "@lib/auth";
|
||||
import { symmetricEncrypt } from "@lib/crypto";
|
||||
import { AppleCalendar } from "@lib/integrations/Apple/AppleCalendarAdapter";
|
||||
import { getCalendar } from "@lib/integrations/calendar/CalendarManager";
|
||||
import logger from "@lib/logger";
|
||||
import prisma from "@lib/prisma";
|
||||
|
||||
@@ -35,11 +35,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
};
|
||||
|
||||
try {
|
||||
const dav = new AppleCalendar({
|
||||
const dav = getCalendar({
|
||||
id: 0,
|
||||
...data,
|
||||
});
|
||||
await dav.listCalendars();
|
||||
await dav?.listCalendars();
|
||||
await prisma.credential.create({
|
||||
data,
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import { getSession } from "@lib/auth";
|
||||
import { symmetricEncrypt } from "@lib/crypto";
|
||||
import { CalDavCalendar } from "@lib/integrations/CalDav/CalDavCalendarAdapter";
|
||||
import { getCalendar } from "@lib/integrations/calendar/CalendarManager";
|
||||
import logger from "@lib/logger";
|
||||
import prisma from "@lib/prisma";
|
||||
|
||||
@@ -38,11 +38,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
};
|
||||
|
||||
try {
|
||||
const dav = new CalDavCalendar({
|
||||
const dav = getCalendar({
|
||||
id: 0,
|
||||
...data,
|
||||
});
|
||||
await dav.listCalendars();
|
||||
await dav?.listCalendars();
|
||||
await prisma.credential.create({
|
||||
data,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user