feat: refactor quest models

+ separate stage and exception
+ reuse commandResponder
This commit is contained in:
Lin, Hung-Shin committed 2023-11-26 18:29:52 +08:00
1 parent b41e67ee0b
commit bb968706ad
10 files changed
+146 -94

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import { Schema } from 'mongoose'
const fileConditionSchema = new Schema({
path: {
type: String,
required: true,
},
type: String,
exists: {
type: Boolean,
default: true,
},
})
const conditionSchema = new Schema({
command: [String],
output: [String],
error: [String],
pwd: [String],
files: [fileConditionSchema],
})
conditionSchema.add({
or: [conditionSchema],
not: conditionSchema,
})
export default conditionSchema