mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
refactor models to typescript
This commit is contained in:
1 parent
253bd04588
commit
ee03b9999e
16 files changed
+3
-1
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user