Skip to content

Commit c5f8ced

Browse files
committed
优化:定义优化
1 parent 1eb1848 commit c5f8ced

1 file changed

Lines changed: 61 additions & 190 deletions

File tree

sdk/config.schema.json

Lines changed: 61 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"type": "array",
104104
"description": "该功能下可响应的命令集,支持 6 种类型,由 matches 的类型或 matches.type 决定。",
105105
"items": {
106-
"anyOf": [
106+
"oneOf": [
107107
{
108108
"type": "string",
109109
"description": "简单字符串匹配"
@@ -130,205 +130,76 @@
130130
"name": {
131131
"type": "string",
132132
"description": "匹配名称"
133-
}
134-
},
135-
"additionalProperties": false,
136-
"oneOf": [
137-
{
138-
"if": {
139-
"properties": {
140-
"type": {
141-
"const": "text"
142-
}
143-
}
144-
},
145-
"then": {
146-
"required": [
147-
"text"
148-
],
149-
"properties": {
150-
"text": {
151-
"type": "string",
152-
"description": "匹配文本"
153-
},
154-
"minLength": {
155-
"type": "number",
156-
"description": "最小匹配长度",
157-
"minimum": 1
158-
},
159-
"maxLength": {
160-
"type": "number",
161-
"description": "最大匹配长度",
162-
"minimum": 1,
163-
"maximum": 10000
164-
}
165-
}
166-
}
167133
},
168-
{
169-
"if": {
170-
"properties": {
171-
"type": {
172-
"const": "key"
173-
}
174-
}
175-
},
176-
"then": {
177-
"required": [
178-
"key"
179-
],
180-
"properties": {
181-
"key": {
182-
"type": "string",
183-
"description": "匹配键值"
184-
}
185-
}
186-
}
134+
"regex": {
135+
"type": "string",
136+
"description": "匹配正则表达式"
187137
},
188-
{
189-
"if": {
190-
"properties": {
191-
"type": {
192-
"const": "regex"
193-
}
194-
}
195-
},
196-
"then": {
197-
"required": [
198-
"regex"
199-
],
200-
"properties": {
201-
"regex": {
202-
"type": "string",
203-
"description": "匹配正则"
204-
},
205-
"title": {
206-
"type": "string",
207-
"description": "匹配标题"
208-
},
209-
"minLength": {
210-
"type": "number",
211-
"description": "最小匹配长度",
212-
"minimum": 1
213-
},
214-
"maxLength": {
215-
"type": "number",
216-
"description": "最大匹配长度",
217-
"minimum": 1,
218-
"maximum": 10000
219-
}
220-
}
221-
}
138+
"title": {
139+
"type": "string",
140+
"description": "匹配标题"
222141
},
223-
{
224-
"if": {
225-
"properties": {
226-
"type": {
227-
"const": "file"
228-
}
229-
}
230-
},
231-
"then": {
232-
"properties": {
233-
"title": {
234-
"type": "string",
235-
"description": "匹配标题"
236-
},
237-
"minCount": {
238-
"type": "number",
239-
"description": "最小匹配数量",
240-
"minimum": 1
241-
},
242-
"maxCount": {
243-
"type": "number",
244-
"description": "最大匹配数量",
245-
"minimum": 1,
246-
"maximum": 10000
247-
},
248-
"filterFileType": {
249-
"type": "string",
250-
"description": "文件类型",
251-
"enum": [
252-
"file",
253-
"directory"
254-
]
255-
},
256-
"filterExtensions": {
257-
"type": "array",
258-
"description": "文件扩展名",
259-
"items": {
260-
"type": "string"
261-
}
262-
}
263-
}
264-
}
142+
"minLength": {
143+
"type": "number",
144+
"description": "最小匹配长度",
145+
"minimum": 1
146+
},
147+
"maxLength": {
148+
"type": "number",
149+
"description": "最大匹配长度",
150+
"minimum": 1,
151+
"maximum": 10000
152+
},
153+
"key": {
154+
"type": "string",
155+
"description": "匹配键值"
265156
},
266-
{
267-
"if": {
268-
"properties": {
269-
"type": {
270-
"const": "image"
271-
}
272-
}
273-
},
274-
"then": {
275-
"properties": {
276-
"title": {
277-
"type": "string",
278-
"description": "匹配标题"
279-
}
280-
}
157+
"minCount": {
158+
"type": "number",
159+
"description": "最小匹配数量",
160+
"minimum": 1
161+
},
162+
"maxCount": {
163+
"type": "number",
164+
"description": "最大匹配数量",
165+
"minimum": 1,
166+
"maximum": 10000
167+
},
168+
"filterFileType": {
169+
"type": "string",
170+
"description": "文件类型",
171+
"enum": [
172+
"file",
173+
"directory"
174+
]
175+
},
176+
"filterExtensions": {
177+
"type": "array",
178+
"description": "文件扩展名",
179+
"items": {
180+
"type": "string"
281181
}
282182
},
283-
{
284-
"if": {
285-
"properties": {
286-
"type": {
287-
"const": "window"
288-
}
289-
}
290-
},
291-
"then": {
292-
"properties": {
293-
"title": {
294-
"type": "string",
295-
"description": "匹配标题"
296-
},
297-
"titleRegex": {
298-
"type": "string",
299-
"description": "匹配标题正则"
300-
}
301-
}
183+
"titleRegex": {
184+
"type": "string",
185+
"description": "匹配标题正则"
186+
},
187+
"extensions": {
188+
"type": "array",
189+
"description": "文件扩展名",
190+
"items": {
191+
"type": "string"
302192
}
303193
},
304-
{
305-
"if": {
306-
"properties": {
307-
"type": {
308-
"const": "editor"
309-
}
310-
}
311-
},
312-
"then": {
313-
"properties": {
314-
"extensions": {
315-
"type": "array",
316-
"description": "文件扩展名",
317-
"items": {
318-
"type": "string"
319-
}
320-
},
321-
"faDataTypes": {
322-
"type": "array",
323-
"description": "FocusAny 数据类型",
324-
"items": {
325-
"type": "string"
326-
}
327-
}
328-
}
194+
"faDataTypes": {
195+
"type": "array",
196+
"description": "FocusAny 数据类型",
197+
"items": {
198+
"type": "string"
329199
}
330200
}
331-
]
201+
},
202+
"additionalProperties": false
332203
}
333204
]
334205
}

0 commit comments

Comments
 (0)