Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
manish-singh-bisht committed May 6, 2024
1 parent eb7d02b commit be7e8f1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/backend/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const config = {
OPEN_INT_API_KEY: process.env.OPEN_INT_API_KEY,
OPEN_INT_BASE_API_URL: process.env.OPEN_INT_BASE_API_URL,
TWENTY_ACCOUNT_ID: process.env.TWENTY_ACCOUNT_ID,
GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID!,
GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET!,
};

export default config;
4 changes: 3 additions & 1 deletion packages/backend/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Request, Response } from 'express';

export type CRM_TP_ID = 'zohocrm' | 'sfdc' | 'pipedrive' | 'hubspot' | 'closecrm' | 'ms_dynamics_365_sales';
export type CHAT_TP_ID = 'slack' | 'discord';
export type TICKET_TP_ID = 'linear' | 'clickup' | 'asana' | 'jira' | 'trello' | 'bitbucket';
export type TICKET_TP_ID = 'linear' | 'clickup' | 'asana' | 'jira' | 'trello' | 'bitbucket' | 'github';

export const DEFAULT_SCOPE = {
[TP_ID.hubspot]: [
Expand Down Expand Up @@ -49,6 +49,7 @@ export const DEFAULT_SCOPE = {
[TP_ID.jira]: ['read:jira-work', 'read:jira-user', 'write:jira-work', 'offline_access'],
[TP_ID.ms_dynamics_365_sales]: ['offline_access', 'User.Read'],
[TP_ID.bitbucket]: ['issue', 'issue:write', 'repository', 'account'],
[TP_ID.github]: [],
};

export const mapIntegrationIdToIntegrationName = {
Expand All @@ -66,6 +67,7 @@ export const mapIntegrationIdToIntegrationName = {
[TP_ID.jira]: 'Jira',
[TP_ID.ms_dynamics_365_sales]: 'Microsoft Dynamics 365 Sales',
[TP_ID.bitbucket]: 'Bitbucket',
[TP_ID.github]: 'GitHub',
};

export const rootSchemaMappingId = 'revertRootSchemaMapping';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "TP_ID" ADD VALUE 'github';
1 change: 1 addition & 0 deletions packages/backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum TP_ID {
trello
jira
bitbucket
github
}

enum ENV {
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ async function main() {
tpId === 'clickup' ||
tpId === 'jira' ||
tpId === 'trello' ||
tpId === 'bitbucket'
tpId === 'bitbucket' ||
tpId === 'github'
)
)
return;
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/routes/v1/ticket/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import clickup from './authHandlers/clickup';
import trello from './authHandlers/trello';
import bitbucket from './authHandlers/bitbucket';
import jira from './authHandlers/jira';
import github from './authHandlers/github';

const authRouter = express.Router();

Expand Down Expand Up @@ -68,6 +69,8 @@ authRouter.get('/oauth-callback', async (req, res) => {
return jira.handleOAuth(authProps);
case TP_ID.bitbucket:
return bitbucket.handleOAuth(authProps);
case TP_ID.github:
return github.handleOAuth(authProps);

default:
return processOAuthResult({
Expand Down

0 comments on commit be7e8f1

Please sign in to comment.