mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
29 lines
460 B
JavaScript
29 lines
460 B
JavaScript
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
|