Finish Netlify integration v1 full-loop

This commit is contained in:
Tuan Dang
2022-12-14 18:18:21 -05:00
parent fe17d8459b
commit 787e54fb91
14 changed files with 441 additions and 108 deletions
+11 -1
View File
@@ -16,7 +16,9 @@ export interface IIntegration {
isActive: boolean;
app: string;
target: string;
integration: 'heroku' | 'netlify';
context: string;
siteId: string;
integration: 'heroku' | 'vercel' | 'netlify';
integrationAuth: Types.ObjectId;
}
@@ -44,6 +46,14 @@ const integrationSchema = new Schema<IIntegration>(
type: String,
default: null
},
context: { // netlify-specific context (deploy)
type: String,
default: null
},
siteId: { // netlify-specific site (app) id
type: String,
default: null
},
integration: {
type: String,
enum: [
+6 -2
View File
@@ -8,8 +8,9 @@ import {
export interface IIntegrationAuth {
_id: Types.ObjectId;
workspace: Types.ObjectId;
integration: 'heroku' | 'netlify';
integration: 'heroku' | 'vercel' | 'netlify';
teamId: string;
accountId: string;
refreshCiphertext?: string;
refreshIV?: string;
refreshTag?: string;
@@ -34,7 +35,10 @@ const integrationAuthSchema = new Schema<IIntegrationAuth>(
],
required: true
},
teamId: { // vercel-specific integration param set at OAuth2 code-token exchange
teamId: { // vercel-specific integration param
type: String
},
accountId: { // netlify-specific integration param
type: String
},
refreshCiphertext: {