mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Github Sync: initial commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import mongoose from "../../../../app/src/infrastructure/Mongoose.mjs"
|
||||
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
export const GitHubSyncProjectStatesSchema = new Schema(
|
||||
{
|
||||
projectId: { type: ObjectId, ref: 'Project', required: true, unique: true },
|
||||
repoFullName: { type: String, required: true },
|
||||
defaultBranchName: { type: String, default: null },
|
||||
mergeStatus: { type: String, enum: ['clean', 'conflict', 'diverged'], default: 'clean' },
|
||||
lastSyncCommit: { type: String, default: null },
|
||||
lastSyncVersion: { type: Number, default: null },
|
||||
unmergedBranchName: { type: String, default: null },
|
||||
unmergedBranchHead: { type: String, default: null },
|
||||
conflictVersion: { type: Number, default: null },
|
||||
},
|
||||
{ collection: 'githubSyncProjectStates', minimize: false }
|
||||
)
|
||||
|
||||
export const GitHubSyncProjectStates = mongoose.model(
|
||||
'GitHubSyncProjectStates',
|
||||
GitHubSyncProjectStatesSchema,
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
import mongoose from "../../../../app/src/infrastructure/Mongoose.mjs"
|
||||
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
export const GitHubSyncUserCredentialsSchema = new Schema(
|
||||
{
|
||||
userId: { type: ObjectId, ref: 'User', required: true, unique: true },
|
||||
github: { type: String, required: true },
|
||||
},
|
||||
{ collection: 'githubSyncUserCredentials', minimize: false }
|
||||
)
|
||||
|
||||
export const GitHubSyncUserCredentials = mongoose.model(
|
||||
'GitHubSyncUserCredentials',
|
||||
GitHubSyncUserCredentialsSchema,
|
||||
)
|
||||
Reference in New Issue
Block a user