Revert "Slack Oauth integration - api route ideas"
This reverts commit 35ffa78e92
.
This commit is contained in:
parent
f0602df29f
commit
a369ba895f
|
@ -1,13 +1,11 @@
|
||||||
import * as example from "./_example";
|
import * as example from "./_example";
|
||||||
import * as dailyvideo from "./dailyvideo";
|
import * as dailyvideo from "./dailyvideo";
|
||||||
import * as slackcalendar from "./slackcalendar";
|
|
||||||
import * as zoomvideo from "./zoomvideo";
|
import * as zoomvideo from "./zoomvideo";
|
||||||
|
|
||||||
const appStore = {
|
const appStore = {
|
||||||
example,
|
example,
|
||||||
dailyvideo,
|
dailyvideo,
|
||||||
zoomvideo,
|
zoomvideo,
|
||||||
slackcalendar,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default appStore;
|
export default appStore;
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
import { InstallProvider } from "@slack/oauth";
|
|
||||||
import type { NextApiRequest, NextApiResponse } from "next";
|
|
||||||
import { stringify } from "querystring";
|
|
||||||
|
|
||||||
import { BASE_URL } from "@calcom/lib/constants";
|
|
||||||
import prisma from "@calcom/prisma";
|
|
||||||
|
|
||||||
const client_id = process.env.SLACK_CLIENT_ID;
|
|
||||||
const client_secret = process.env.SLACK_CLIENT_SECRET;
|
|
||||||
const scopes = ["incoming-webhook", "commands"];
|
|
||||||
|
|
||||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
||||||
if (req.method === "GET") {
|
|
||||||
// Get user
|
|
||||||
await prisma.user.findFirst({
|
|
||||||
rejectOnNotFound: true,
|
|
||||||
where: {
|
|
||||||
id: req.session?.user?.id,
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const params = {
|
|
||||||
client_id,
|
|
||||||
scope: scopes.join(","),
|
|
||||||
};
|
|
||||||
const query = stringify(params);
|
|
||||||
const url = `https://slack.com/oauth/v2/authorize?${query}`;
|
|
||||||
res.status(200).json({ url });
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
export { default as add } from "./add";
|
|
|
@ -1,2 +0,0 @@
|
||||||
// Any commands registered within slack will send an api request to the endpoint
|
|
||||||
// `/api/integrations/slackcalendar/listeners/action/acitonId`
|
|
|
@ -1,2 +0,0 @@
|
||||||
// Any commands registered within slack will send an api request to the endpoint
|
|
||||||
// `/api/integrations/slackcalendar/listeners/commands/actionId`
|
|
|
@ -1,2 +0,0 @@
|
||||||
// Any events are triggered within slack slack will send an api request to the endpoint
|
|
||||||
// `/api/integrations/slackcalendar/listeners/events/actionId`
|
|
|
@ -1,2 +0,0 @@
|
||||||
// Any views that need to display within slack slack will send an api request to the endpoint
|
|
||||||
// `/api/integrations/slackcalendar/listeners/views/[actionId]`
|
|
|
@ -1,25 +0,0 @@
|
||||||
import type { App } from "@calcom/types/App";
|
|
||||||
|
|
||||||
import _package from "./package.json";
|
|
||||||
|
|
||||||
export const metadata = {
|
|
||||||
name: _package.name,
|
|
||||||
description: _package.description,
|
|
||||||
installed: true,
|
|
||||||
category: "video",
|
|
||||||
imageSrc: "cal-com-icon.svg",
|
|
||||||
label: "Slack App",
|
|
||||||
logo: "cal-com-icon.svg",
|
|
||||||
publisher: "Cal.com",
|
|
||||||
rating: 5,
|
|
||||||
reviews: 69,
|
|
||||||
slug: "slack_calendar",
|
|
||||||
title: "Slack App",
|
|
||||||
trending: true,
|
|
||||||
type: "slack_calendar",
|
|
||||||
url: "https://cal.com/",
|
|
||||||
variant: "conferencing",
|
|
||||||
verified: true,
|
|
||||||
} as App;
|
|
||||||
|
|
||||||
export * as api from "./api";
|
|
|
@ -1 +0,0 @@
|
||||||
// export * from "./constants";
|
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "https://json.schemastore.org/package.json",
|
|
||||||
"private": true,
|
|
||||||
"name": "@calcom/slackcalendar",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"main": "./index.ts",
|
|
||||||
"description": "This is a package for the intergration of slack into the app-store",
|
|
||||||
"dependencies": {
|
|
||||||
"@calcom/prisma": "*",
|
|
||||||
"@slack/oauth": "^2.4.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@calcom/types": "*"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
<svg width="56" height="56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<rect width="56" height="56" rx="12" fill="#292929" />
|
|
||||||
<path
|
|
||||||
d="M18.628 36.781c2.846 0 4.946-1.096 6.183-2.59l-2.38-2.03c-.957 1.05-2.147 1.587-3.733 1.587-3.22 0-5.204-2.427-5.204-5.413 0-2.987 1.984-5.46 5.134-5.46 1.47 0 2.683.513 3.663 1.54l2.31-2.007c-1.47-1.75-3.313-2.567-5.973-2.567-5.04 0-8.517 3.803-8.517 8.493 0 4.667 3.663 8.447 8.517 8.447ZM31.69 36.781c2.17 0 3.267-.91 3.92-2.286v1.983h3.057V24.344H35.54v1.914c-.653-1.307-1.75-2.17-3.85-2.17-3.337 0-5.997 2.87-5.997 6.37s2.66 6.323 5.997 6.323Zm-2.847-6.346c0-1.89 1.354-3.5 3.36-3.5 2.077 0 3.407 1.633 3.407 3.523 0 1.89-1.33 3.477-3.407 3.477-2.006 0-3.36-1.657-3.36-3.5ZM41.472 36.478h3.15V19.444h-3.15v17.034Z"
|
|
||||||
fill="#fff" />
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 806 B |
Loading…
Reference in New Issue
Block a user