Preliminary Vercel integration

This commit is contained in:
Tuan Dang
2022-12-13 13:59:21 -05:00
parent 271c810692
commit 3e623922b4
19 changed files with 521 additions and 118 deletions
+14 -2
View File
@@ -1,10 +1,15 @@
import { Schema, model, Types } from 'mongoose';
import { INTEGRATION_HEROKU, INTEGRATION_NETLIFY } from '../variables';
import {
INTEGRATION_HEROKU,
INTEGRATION_VERCEL,
INTEGRATION_NETLIFY
} from '../variables';
export interface IIntegrationAuth {
_id: Types.ObjectId;
workspace: Types.ObjectId;
integration: 'heroku' | 'netlify';
teamId: string;
refreshCiphertext?: string;
refreshIV?: string;
refreshTag?: string;
@@ -22,9 +27,16 @@ const integrationAuthSchema = new Schema<IIntegrationAuth>(
},
integration: {
type: String,
enum: [INTEGRATION_HEROKU, INTEGRATION_NETLIFY],
enum: [
INTEGRATION_HEROKU,
INTEGRATION_VERCEL,
INTEGRATION_NETLIFY
],
required: true
},
teamId: { // vercel-specific integration param set at OAuth2 code-token exchange
type: String
},
refreshCiphertext: {
type: String,
select: false