- 实现 db 类型 checker,使用 Bun 内置 SQL 类 - 支持 db.url 连接字符串和可选 db.query 查询语句 - expect 支持 maxDurationMs、rowCount、rows 逐列校验 - 凭据屏蔽序列化输出 - SQLite 内存数据库测试覆盖
936 lines
30 KiB
JSON
936 lines
30 KiB
JSON
{
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"targets"
|
|
],
|
|
"properties": {
|
|
"defaults": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"interval": {
|
|
"type": "string"
|
|
},
|
|
"timeout": {
|
|
"type": "string"
|
|
},
|
|
"http": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"headers": {
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
},
|
|
"type": "object"
|
|
},
|
|
"maxBodyBytes": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
}
|
|
]
|
|
},
|
|
"method": {
|
|
"anyOf": [
|
|
{
|
|
"const": "DELETE",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "GET",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "HEAD",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "OPTIONS",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "PATCH",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "POST",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "PUT",
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"cmd": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"cwd": {
|
|
"type": "string"
|
|
},
|
|
"maxOutputBytes": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"db": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {}
|
|
}
|
|
}
|
|
},
|
|
"runtime": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"maxConcurrentChecks": {
|
|
"minimum": 1,
|
|
"type": "integer"
|
|
},
|
|
"retention": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"server": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"dataDir": {
|
|
"type": "string"
|
|
},
|
|
"host": {
|
|
"type": "string"
|
|
},
|
|
"port": {
|
|
"maximum": 65535,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"targets": {
|
|
"minItems": 1,
|
|
"type": "array",
|
|
"items": {
|
|
"anyOf": [
|
|
{
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"type",
|
|
"http"
|
|
],
|
|
"properties": {
|
|
"expect": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"body": {
|
|
"type": "array",
|
|
"items": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"css": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"selector"
|
|
],
|
|
"properties": {
|
|
"attr": {
|
|
"type": "string"
|
|
},
|
|
"selector": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
},
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"empty": {
|
|
"type": "boolean"
|
|
},
|
|
"equals": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"exists": {
|
|
"type": "boolean"
|
|
},
|
|
"gt": {
|
|
"type": "number"
|
|
},
|
|
"gte": {
|
|
"type": "number"
|
|
},
|
|
"lt": {
|
|
"type": "number"
|
|
},
|
|
"lte": {
|
|
"type": "number"
|
|
},
|
|
"match": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"json": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"path"
|
|
],
|
|
"properties": {
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"empty": {
|
|
"type": "boolean"
|
|
},
|
|
"equals": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"exists": {
|
|
"type": "boolean"
|
|
},
|
|
"gt": {
|
|
"type": "number"
|
|
},
|
|
"gte": {
|
|
"type": "number"
|
|
},
|
|
"lt": {
|
|
"type": "number"
|
|
},
|
|
"lte": {
|
|
"type": "number"
|
|
},
|
|
"match": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"regex": {
|
|
"type": "string"
|
|
},
|
|
"xpath": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"path"
|
|
],
|
|
"properties": {
|
|
"path": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
},
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"empty": {
|
|
"type": "boolean"
|
|
},
|
|
"equals": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"exists": {
|
|
"type": "boolean"
|
|
},
|
|
"gt": {
|
|
"type": "number"
|
|
},
|
|
"gte": {
|
|
"type": "number"
|
|
},
|
|
"lt": {
|
|
"type": "number"
|
|
},
|
|
"lte": {
|
|
"type": "number"
|
|
},
|
|
"match": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"headers": {
|
|
"additionalProperties": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"minProperties": 1,
|
|
"type": "object",
|
|
"properties": {
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"empty": {
|
|
"type": "boolean"
|
|
},
|
|
"equals": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"exists": {
|
|
"type": "boolean"
|
|
},
|
|
"gt": {
|
|
"type": "number"
|
|
},
|
|
"gte": {
|
|
"type": "number"
|
|
},
|
|
"lt": {
|
|
"type": "number"
|
|
},
|
|
"lte": {
|
|
"type": "number"
|
|
},
|
|
"match": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"type": "object"
|
|
},
|
|
"maxDurationMs": {
|
|
"minimum": 0,
|
|
"type": "number"
|
|
},
|
|
"status": {
|
|
"type": "array",
|
|
"items": {
|
|
"anyOf": [
|
|
{
|
|
"maximum": 599,
|
|
"minimum": 100,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"pattern": "^[1-5]xx$",
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"group": {
|
|
"type": "string"
|
|
},
|
|
"interval": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
},
|
|
"timeout": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"const": "http",
|
|
"type": "string"
|
|
},
|
|
"http": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"url"
|
|
],
|
|
"properties": {
|
|
"body": {
|
|
"type": "string"
|
|
},
|
|
"headers": {
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
},
|
|
"type": "object"
|
|
},
|
|
"ignoreSSL": {
|
|
"type": "boolean"
|
|
},
|
|
"maxBodyBytes": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
}
|
|
]
|
|
},
|
|
"maxRedirects": {
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"method": {
|
|
"anyOf": [
|
|
{
|
|
"const": "DELETE",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "GET",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "HEAD",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "OPTIONS",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "PATCH",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "POST",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"const": "PUT",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"type",
|
|
"cmd"
|
|
],
|
|
"properties": {
|
|
"expect": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"exitCode": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"maxDurationMs": {
|
|
"minimum": 0,
|
|
"type": "number"
|
|
},
|
|
"stderr": {
|
|
"type": "array",
|
|
"items": {
|
|
"additionalProperties": false,
|
|
"minProperties": 1,
|
|
"type": "object",
|
|
"properties": {
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"empty": {
|
|
"type": "boolean"
|
|
},
|
|
"equals": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"exists": {
|
|
"type": "boolean"
|
|
},
|
|
"gt": {
|
|
"type": "number"
|
|
},
|
|
"gte": {
|
|
"type": "number"
|
|
},
|
|
"lt": {
|
|
"type": "number"
|
|
},
|
|
"lte": {
|
|
"type": "number"
|
|
},
|
|
"match": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"stdout": {
|
|
"type": "array",
|
|
"items": {
|
|
"additionalProperties": false,
|
|
"minProperties": 1,
|
|
"type": "object",
|
|
"properties": {
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"empty": {
|
|
"type": "boolean"
|
|
},
|
|
"equals": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"exists": {
|
|
"type": "boolean"
|
|
},
|
|
"gt": {
|
|
"type": "number"
|
|
},
|
|
"gte": {
|
|
"type": "number"
|
|
},
|
|
"lt": {
|
|
"type": "number"
|
|
},
|
|
"lte": {
|
|
"type": "number"
|
|
},
|
|
"match": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"group": {
|
|
"type": "string"
|
|
},
|
|
"interval": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
},
|
|
"timeout": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"const": "cmd",
|
|
"type": "string"
|
|
},
|
|
"cmd": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"exec"
|
|
],
|
|
"properties": {
|
|
"args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"cwd": {
|
|
"type": "string"
|
|
},
|
|
"env": {
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
},
|
|
"type": "object"
|
|
},
|
|
"exec": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
},
|
|
"maxOutputBytes": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"type",
|
|
"db"
|
|
],
|
|
"properties": {
|
|
"expect": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"maxDurationMs": {
|
|
"minimum": 0,
|
|
"type": "number"
|
|
},
|
|
"rowCount": {
|
|
"additionalProperties": false,
|
|
"minProperties": 1,
|
|
"type": "object",
|
|
"properties": {
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"empty": {
|
|
"type": "boolean"
|
|
},
|
|
"equals": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"exists": {
|
|
"type": "boolean"
|
|
},
|
|
"gt": {
|
|
"type": "number"
|
|
},
|
|
"gte": {
|
|
"type": "number"
|
|
},
|
|
"lt": {
|
|
"type": "number"
|
|
},
|
|
"lte": {
|
|
"type": "number"
|
|
},
|
|
"match": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"rows": {
|
|
"type": "array",
|
|
"items": {
|
|
"additionalProperties": false,
|
|
"minProperties": 1,
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^(.*)$": {
|
|
"anyOf": [
|
|
{
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"minProperties": 1,
|
|
"type": "object",
|
|
"properties": {
|
|
"contains": {
|
|
"type": "string"
|
|
},
|
|
"empty": {
|
|
"type": "boolean"
|
|
},
|
|
"equals": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"type": "null"
|
|
},
|
|
{
|
|
"items": {},
|
|
"type": "array"
|
|
},
|
|
{
|
|
"additionalProperties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"exists": {
|
|
"type": "boolean"
|
|
},
|
|
"gt": {
|
|
"type": "number"
|
|
},
|
|
"gte": {
|
|
"type": "number"
|
|
},
|
|
"lt": {
|
|
"type": "number"
|
|
},
|
|
"lte": {
|
|
"type": "number"
|
|
},
|
|
"match": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"group": {
|
|
"type": "string"
|
|
},
|
|
"interval": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
},
|
|
"timeout": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"const": "db",
|
|
"type": "string"
|
|
},
|
|
"db": {
|
|
"additionalProperties": false,
|
|
"type": "object",
|
|
"required": [
|
|
"url"
|
|
],
|
|
"properties": {
|
|
"query": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
},
|
|
"url": {
|
|
"minLength": 1,
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"$id": "https://dial.local/probe-config.schema.json",
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"definitions": {}
|
|
}
|