[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:
authored and GitHub committed 2022-01-06 12:28:31 -05:00
1 parent 8a70ea66e9
commit bd2a795d7a
48 files changed
+1098 -945

No files matched your search

+3 -3
View File
@@ -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,
});
+3 -3
View File
@@ -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,
});