@social-data/social-neuron-subscription 1.0.0-beta.3 → 1.0.0-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/manifest.json CHANGED
@@ -1,9 +1,128 @@
1
1
  {
2
- "revision": 6,
2
+ "revision": 12,
3
3
  "capability": "subscription",
4
4
  "command": "social-neuron-subscription",
5
+ "default_action": null,
5
6
  "mcp_path": "/subscription/mcp",
6
7
  "tools": [
8
+ {
9
+ "action": "get-field-values",
10
+ "op": "get_field_values",
11
+ "name": "subscription/get_field_values",
12
+ "summary": "取字段值字典 [{code, value}];**仅在需要把导出的码值换成中文时按需取用**。",
13
+ "description": "取字段值字典 [{code, value}];**仅在需要把导出的码值换成中文时按需取用**。\n\n枚举字段与编码字段统一走这里(值从哪来是元数据内部的事,对外只有\"有没有字典\"之分)。\n\n换值**不是订阅的标准步骤**:导出文件默认按大库原值交付,只有调用方(或其用户)明确要求\n中文时才用这份字典自行替换 —— 系统不做出参自动回显,也不读产出的文件。\n\n**空列表原样返回**:不在出参里猜原因 —— \"该字段真是明文(本就无字典)\"与\"元数据侧没配值来源\"\n在出参上无法区分,猜错反而误导(说成\"直接当原值用\"会让调用方把一列 code 当中文发出去)。",
14
+ "input_schema": {
15
+ "additionalProperties": false,
16
+ "properties": {
17
+ "field": {
18
+ "description": "字段 name_en(取自 list_fields);仅 is_enum / is_code 为真的字段有值字典(按需取用:只有要把导出的码值换成中文时才需要)",
19
+ "title": "Field",
20
+ "type": "string"
21
+ },
22
+ "keyword": {
23
+ "anyOf": [
24
+ {
25
+ "maxLength": 64,
26
+ "type": "string"
27
+ },
28
+ {
29
+ "type": "null"
30
+ }
31
+ ],
32
+ "default": null,
33
+ "description": "按中文值 / code 模糊过滤(如品牌搜「兰」);不传=全量,编码类字段(品牌/品类标签)可上千条,建议带",
34
+ "title": "Keyword"
35
+ }
36
+ },
37
+ "required": [
38
+ "field"
39
+ ],
40
+ "title": "SubFieldValuesInput",
41
+ "type": "object"
42
+ },
43
+ "output_schema": {
44
+ "$defs": {
45
+ "SubFieldValue": {
46
+ "additionalProperties": false,
47
+ "description": "值字典的一项。\n\n刻意**不复用** ``commons.metadata.schemas.values.FieldValue``:那是元数据面的内部契约,\n字段说明里带着上游系统的字段名(``tagCode`` / ``tagName`` 之类),对外没有意义也不该暴露。\n这里只说调用方需要知道的两件事:导出列里存的是什么、对应的中文是什么。",
48
+ "properties": {
49
+ "code": {
50
+ "description": "编码值 —— 导出列里实际存的那个值(如 1、V200500020023)",
51
+ "title": "Code",
52
+ "type": "string"
53
+ },
54
+ "value": {
55
+ "description": "该编码值对应的中文",
56
+ "title": "Value",
57
+ "type": "string"
58
+ }
59
+ },
60
+ "required": [
61
+ "code",
62
+ "value"
63
+ ],
64
+ "title": "SubFieldValue",
65
+ "type": "object"
66
+ }
67
+ },
68
+ "additionalProperties": false,
69
+ "properties": {
70
+ "field": {
71
+ "description": "字段 name_en(回显入参)",
72
+ "title": "Field",
73
+ "type": "string"
74
+ },
75
+ "items": {
76
+ "description": "值字典 [{code, value}]:code 是导出列里存的值,value 是对应中文;明文字段无字典,返回空列表",
77
+ "items": {
78
+ "$ref": "#/$defs/SubFieldValue"
79
+ },
80
+ "title": "Items",
81
+ "type": "array"
82
+ },
83
+ "total": {
84
+ "description": "值总数",
85
+ "title": "Total",
86
+ "type": "integer"
87
+ }
88
+ },
89
+ "required": [
90
+ "field",
91
+ "items",
92
+ "total"
93
+ ],
94
+ "title": "SubFieldValueList",
95
+ "type": "object"
96
+ },
97
+ "flags": [
98
+ {
99
+ "flag": "--field",
100
+ "field": "field",
101
+ "type": "string",
102
+ "required": true,
103
+ "desc": "字段 name_en(取自 list_fields);仅 is_enum / is_code 为真的字段有值字典(按需取用:只有要把导出的码值换成中文时才需要)"
104
+ },
105
+ {
106
+ "flag": "--keyword",
107
+ "field": "keyword",
108
+ "type": "string",
109
+ "required": false,
110
+ "desc": "按中文值 / code 模糊过滤(如品牌搜「兰」);不传=全量,编码类字段(品牌/品类标签)可上千条,建议带"
111
+ }
112
+ ],
113
+ "transport": {
114
+ "method": "POST",
115
+ "path": "/subscription/get_field_values",
116
+ "send": "args"
117
+ },
118
+ "errors": [
119
+ "auth_error",
120
+ "validation",
121
+ "api_error",
122
+ "network",
123
+ "internal"
124
+ ]
125
+ },
7
126
  {
8
127
  "action": "job-create",
9
128
  "op": "job_create",
@@ -82,9 +201,37 @@
82
201
  "title": "OctoTarget",
83
202
  "type": "object"
84
203
  },
204
+ "PlatformSite": {
205
+ "additionalProperties": false,
206
+ "properties": {
207
+ "platform": {
208
+ "description": "具体平台编码,禁止包含 *,取 list_platforms 的 name_en;全平台须逐一列出平台组合",
209
+ "minLength": 1,
210
+ "pattern": "^[^*]+$",
211
+ "title": "Platform",
212
+ "type": "string"
213
+ },
214
+ "sites": {
215
+ "description": "站点编码数组,取 list_sites 的 value;[\"*\"] 表示该平台全部站点,不可混用",
216
+ "items": {
217
+ "minLength": 1,
218
+ "type": "string"
219
+ },
220
+ "minItems": 1,
221
+ "title": "Sites",
222
+ "type": "array"
223
+ }
224
+ },
225
+ "required": [
226
+ "platform",
227
+ "sites"
228
+ ],
229
+ "title": "PlatformSite",
230
+ "type": "object"
231
+ },
85
232
  "SftpTarget": {
86
233
  "additionalProperties": false,
87
- "description": "sftp(本期):把导出文件上传到 SFTP 远端目录。",
234
+ "description": "sftp(本期):把导出文件上传到 SFTP 远端目录。\n目录与文件名都支持日期变量 ``yyyyMMdd`` / ``yyyyMM`` / ``yyyy``,同一个 task\n重跑多少次,远端路径与文件名都不变。",
88
235
  "properties": {
89
236
  "type": {
90
237
  "const": "sftp",
@@ -93,31 +240,49 @@
93
240
  "type": "string"
94
241
  },
95
242
  "host": {
96
- "description": "SFTP 主机",
243
+ "description": "SFTP 主机,不能为空白",
244
+ "minLength": 1,
97
245
  "title": "Host",
98
246
  "type": "string"
99
247
  },
100
248
  "port": {
101
249
  "default": 22,
102
- "description": "端口,默认 22",
250
+ "description": "端口,1–65535,默认 22",
251
+ "maximum": 65535,
252
+ "minimum": 1,
103
253
  "title": "Port",
104
254
  "type": "integer"
105
255
  },
106
256
  "username": {
107
- "description": "登录用户名",
257
+ "description": "登录用户名,不能为空白",
258
+ "minLength": 1,
108
259
  "title": "Username",
109
260
  "type": "string"
110
261
  },
111
262
  "password": {
112
- "description": "登录密码",
263
+ "description": "登录密码,不能为空白,保留首尾空格",
264
+ "minLength": 1,
113
265
  "title": "Password",
114
266
  "type": "string"
115
267
  },
116
268
  "remote_path": {
117
- "description": "远端目录/路径",
269
+ "description": "远端目录/路径。可在**任意一层**用日期变量,但变量必须**独占一层**:`/data/sub/yyyyMM/yyyyMMdd` 合法,`/data/sub_yyyyMMdd` 非法。只认 yyyyMMdd / yyyyMM / yyyy 三种;不允许 '..'、空目录层。",
118
270
  "title": "Remote Path",
119
271
  "type": "string"
120
272
  },
273
+ "filename_template": {
274
+ "anyOf": [
275
+ {
276
+ "type": "string"
277
+ },
278
+ {
279
+ "type": "null"
280
+ }
281
+ ],
282
+ "default": null,
283
+ "description": "自定义文件名模板(不含扩展名)。只允许字母、数字、'_'、'-' 与日期变量,且变量前后必须是 '_' 或首尾:`daily_yyyyMMdd_export`、`yyyyMM_summary` 合法,`dailyyyyyMMdd`、`report-yyyyMMdd-x` 非法。系统统一追加 `_<task_id>` 与扩展名。不传=沿用默认 `<job_id>_<task_id>.<ext>`。",
284
+ "title": "Filename Template"
285
+ },
121
286
  "format": {
122
287
  "default": "json",
123
288
  "description": "文件格式:csv/excel/json(默认 json)",
@@ -139,12 +304,71 @@
139
304
  ],
140
305
  "title": "SftpTarget",
141
306
  "type": "object"
307
+ },
308
+ "TopSpec": {
309
+ "additionalProperties": false,
310
+ "description": "全局TopN排序规格(subscription专用)。",
311
+ "properties": {
312
+ "field": {
313
+ "description": "排序字段(name_en);仅支持可排序类型(keyword/long/double/date)",
314
+ "title": "Field",
315
+ "type": "string"
316
+ },
317
+ "order": {
318
+ "default": "desc",
319
+ "description": "排序方向:desc降序(取最大的N个)/asc升序(取最小的N个)",
320
+ "enum": [
321
+ "asc",
322
+ "desc"
323
+ ],
324
+ "title": "Order",
325
+ "type": "string"
326
+ }
327
+ },
328
+ "required": [
329
+ "field"
330
+ ],
331
+ "title": "TopSpec",
332
+ "type": "object"
142
333
  }
143
334
  },
144
335
  "additionalProperties": false,
145
336
  "properties": {
337
+ "source": {
338
+ "description": "历史热门站点中文名数组,取 list_source;与 platform_site 必须二选一",
339
+ "items": {
340
+ "minLength": 1,
341
+ "type": "string"
342
+ },
343
+ "minItems": 1,
344
+ "title": "Source",
345
+ "type": "array"
346
+ },
347
+ "platform_site": {
348
+ "anyOf": [
349
+ {
350
+ "items": {
351
+ "$ref": "#/$defs/PlatformSite"
352
+ },
353
+ "minItems": 1,
354
+ "type": "array"
355
+ },
356
+ {
357
+ "type": "null"
358
+ }
359
+ ],
360
+ "default": null,
361
+ "description": "元数据平台站点组合;platform 取 list_platforms.name_en,sites 取 list_sites.value;与 source 二选一",
362
+ "title": "Platform Site"
363
+ },
364
+ "confirmed": {
365
+ "default": false,
366
+ "description": "是否已确认继续并同意系统超限处理规则;超量时默认拒绝,true 允许保存但仍按上限截断;不跳过其他校验,不保存到 job,TopN 不适用",
367
+ "title": "Confirmed",
368
+ "type": "boolean"
369
+ },
146
370
  "name": {
147
- "description": "job 名称,全局唯一",
371
+ "description": "job 名称,同一凭证(token)下唯一",
148
372
  "maxLength": 128,
149
373
  "minLength": 1,
150
374
  "title": "Name",
@@ -160,26 +384,40 @@
160
384
  "title": "Rule Ids",
161
385
  "type": "array"
162
386
  },
163
- "source": {
164
- "description": "站点数组,至少 1 个;只能取已配置站点",
165
- "items": {
166
- "minLength": 1,
167
- "type": "string"
168
- },
169
- "minItems": 1,
170
- "title": "Source",
171
- "type": "array"
172
- },
173
387
  "published": {
174
- "description": "发布时间口径:T-0(当天)/ T-1(昨天)/ T-7(近7天到昨天)",
175
- "enum": [
176
- "T-0",
177
- "T-1",
178
- "T-7"
179
- ],
388
+ "description": "**发布时间**口径(必填,主口径 —— 它同时决定查哪个月的索引、怎么拆分片,所以不能缺省)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
389
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)$",
180
390
  "title": "Published",
181
391
  "type": "string"
182
392
  },
393
+ "idate": {
394
+ "anyOf": [
395
+ {
396
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)$",
397
+ "type": "string"
398
+ },
399
+ {
400
+ "type": "null"
401
+ }
402
+ ],
403
+ "default": null,
404
+ "description": "**入库时间**口径(选填,不传=该维度不过滤)。在发布时间窗**之内**再 AND 一层:入库时间落在本区间的数据。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
405
+ "title": "Idate"
406
+ },
407
+ "udate": {
408
+ "anyOf": [
409
+ {
410
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)$",
411
+ "type": "string"
412
+ },
413
+ {
414
+ "type": "null"
415
+ }
416
+ ],
417
+ "default": null,
418
+ "description": "**更新时间**口径(选填,不传=该维度不过滤)。在发布时间窗**之内**再 AND 一层:更新时间落在本区间的数据。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
419
+ "title": "Udate"
420
+ },
183
421
  "frequency": {
184
422
  "description": "自然语言同步频率,系统转 cron(东八区)。可指定具体时间、并**支持一天多次**:如「每天9点」「每天9点和15点」(一天跑两次)「每周一9点」「每小时」「每30分钟」。无法解析为 cron 会被拒绝。",
185
423
  "maxLength": 64,
@@ -188,7 +426,7 @@
188
426
  "type": "string"
189
427
  },
190
428
  "fields": {
191
- "description": "拉取/导出字段;不填拉全量",
429
+ "description": "_id 自动输出,禁止在 fields 中填写;拉取/导出字段;不填拉全量",
192
430
  "items": {
193
431
  "minLength": 1,
194
432
  "type": "string"
@@ -196,6 +434,21 @@
196
434
  "title": "Fields",
197
435
  "type": "array"
198
436
  },
437
+ "size": {
438
+ "anyOf": [
439
+ {
440
+ "maximum": 2147483647,
441
+ "minimum": 1,
442
+ "type": "integer"
443
+ },
444
+ {
445
+ "type": "null"
446
+ }
447
+ ],
448
+ "default": null,
449
+ "description": "每次执行最多导出的记录行数。省略则按模式取默认:普通批量默认最多 500000 条,实际以服务端当前约束为准;传了 top(只取前 N 条)则默认 1,000、上限 10,000",
450
+ "title": "Size"
451
+ },
199
452
  "target": {
200
453
  "anyOf": [
201
454
  {
@@ -224,14 +477,29 @@
224
477
  }
225
478
  ],
226
479
  "default": null,
227
- "description": "投递目标;省略默认 octo(excel)。本期仅接受 octo",
480
+ "description": "投递目标;省略默认 octo(json)。本期支持 octo(上传存储→CDN url)与 sftp(账密上传远端,路径/文件名可用日期变量);kafka: 暂未实现。",
228
481
  "title": "Target"
482
+ },
483
+ "top": {
484
+ "anyOf": [
485
+ {
486
+ "items": {
487
+ "$ref": "#/$defs/TopSpec"
488
+ },
489
+ "type": "array"
490
+ },
491
+ {
492
+ "type": "null"
493
+ }
494
+ ],
495
+ "default": null,
496
+ "description": "只取前 N 条(可选)。**不改变筛选条件** —— 省略时给命中条件的全部数据,传了则在同一批命中结果里按指定字段排序、只取前 size 条。排序跨发布窗内所有日期 / 站点 / 规则**全局生效**(不是每天各取 N)。多字段按顺序作排序优先级(前者相同时比后者)。字段必须是可排序类型(keyword / long / double / date)。该模式下 size 默认 1,000、最大 10,000;且多条规则改为 OR 合并并去重,导出的 kw_ruleId 恒为 topN、无法区分来源规则",
497
+ "title": "Top"
229
498
  }
230
499
  },
231
500
  "required": [
232
501
  "name",
233
502
  "rule_ids",
234
- "source",
235
503
  "published",
236
504
  "frequency"
237
505
  ],
@@ -239,16 +507,150 @@
239
507
  "type": "object"
240
508
  },
241
509
  "output_schema": {
510
+ "$defs": {
511
+ "PlatformSite": {
512
+ "additionalProperties": false,
513
+ "properties": {
514
+ "platform": {
515
+ "description": "具体平台编码,禁止包含 *,取 list_platforms 的 name_en;全平台须逐一列出平台组合",
516
+ "minLength": 1,
517
+ "pattern": "^[^*]+$",
518
+ "title": "Platform",
519
+ "type": "string"
520
+ },
521
+ "sites": {
522
+ "description": "站点编码数组,取 list_sites 的 value;[\"*\"] 表示该平台全部站点,不可混用",
523
+ "items": {
524
+ "minLength": 1,
525
+ "type": "string"
526
+ },
527
+ "minItems": 1,
528
+ "title": "Sites",
529
+ "type": "array"
530
+ }
531
+ },
532
+ "required": [
533
+ "platform",
534
+ "sites"
535
+ ],
536
+ "title": "PlatformSite",
537
+ "type": "object"
538
+ },
539
+ "PrecheckResult": {
540
+ "additionalProperties": false,
541
+ "properties": {
542
+ "checked_at": {
543
+ "description": "检查时间,东八区 ISO 时间",
544
+ "title": "Checked At",
545
+ "type": "string"
546
+ },
547
+ "windows": {
548
+ "additionalProperties": {
549
+ "anyOf": [
550
+ {
551
+ "type": "string"
552
+ },
553
+ {
554
+ "type": "null"
555
+ }
556
+ ]
557
+ },
558
+ "description": "发布时间、入库时间、更新时间三个维度的绝对闭区间;空表示不过滤",
559
+ "title": "Windows",
560
+ "type": "object"
561
+ },
562
+ "matched_rows": {
563
+ "description": "命中行数;count_relation=gte 时为下界,非精确总量",
564
+ "title": "Matched Rows",
565
+ "type": "integer"
566
+ },
567
+ "count_relation": {
568
+ "description": "eq=精确计数;gte=至少命中该数量",
569
+ "enum": [
570
+ "eq",
571
+ "gte"
572
+ ],
573
+ "title": "Count Relation",
574
+ "type": "string"
575
+ },
576
+ "system_limit": {
577
+ "anyOf": [
578
+ {
579
+ "type": "integer"
580
+ },
581
+ {
582
+ "type": "null"
583
+ }
584
+ ],
585
+ "description": "普通批量的系统导出上限;TopN 未执行预检时为空",
586
+ "title": "System Limit"
587
+ },
588
+ "effective_limit": {
589
+ "description": "本次生效的单次最大导出行数",
590
+ "title": "Effective Limit",
591
+ "type": "integer"
592
+ },
593
+ "would_truncate": {
594
+ "description": "当前统计是否超出有效导出数量;TopN 不新增预检",
595
+ "title": "Would Truncate",
596
+ "type": "boolean"
597
+ },
598
+ "checked": {
599
+ "default": true,
600
+ "description": "是否执行数据量统计;TopN 为 false",
601
+ "title": "Checked",
602
+ "type": "boolean"
603
+ },
604
+ "message": {
605
+ "description": "数量提示及调整参数或确认继续的说明",
606
+ "title": "Message",
607
+ "type": "string"
608
+ }
609
+ },
610
+ "required": [
611
+ "checked_at",
612
+ "windows",
613
+ "matched_rows",
614
+ "count_relation",
615
+ "system_limit",
616
+ "effective_limit",
617
+ "would_truncate",
618
+ "message"
619
+ ],
620
+ "title": "PrecheckResult",
621
+ "type": "object"
622
+ }
623
+ },
242
624
  "additionalProperties": false,
243
625
  "description": "订阅 job 出参对象。",
244
626
  "properties": {
245
- "job_id": {
246
- "description": "job ID",
247
- "title": "Job Id",
248
- "type": "integer"
249
- },
250
- "name": {
251
- "description": "job 名称,全局唯一",
627
+ "precheck": {
628
+ "anyOf": [
629
+ {
630
+ "$ref": "#/$defs/PrecheckResult"
631
+ },
632
+ {
633
+ "type": "null"
634
+ }
635
+ ],
636
+ "default": null,
637
+ "description": "本次保存的数据量预检摘要;非预检场景为空,不保存到 job"
638
+ },
639
+ "warnings": {
640
+ "description": "本次保存的超量截断提醒;未超量为空,不保存到 job",
641
+ "items": {
642
+ "type": "string"
643
+ },
644
+ "title": "Warnings",
645
+ "type": "array"
646
+ },
647
+ "job_id": {
648
+ "description": "job ID",
649
+ "title": "Job Id",
650
+ "type": "integer"
651
+ },
652
+ "name": {
653
+ "description": "job 名称,同一凭证(token)下唯一",
252
654
  "title": "Name",
253
655
  "type": "string"
254
656
  },
@@ -261,26 +663,88 @@
261
663
  "type": "array"
262
664
  },
263
665
  "source": {
264
- "description": "站点数组",
666
+ "description": "历史热门站点中文名数组;元数据模式为空数组",
265
667
  "items": {
266
668
  "type": "string"
267
669
  },
268
670
  "title": "Source",
269
671
  "type": "array"
270
672
  },
673
+ "platform_site": {
674
+ "anyOf": [
675
+ {
676
+ "items": {
677
+ "$ref": "#/$defs/PlatformSite"
678
+ },
679
+ "type": "array"
680
+ },
681
+ {
682
+ "type": "null"
683
+ }
684
+ ],
685
+ "default": null,
686
+ "description": "元数据平台站点组合;历史热门站点模式为 null",
687
+ "title": "Platform Site"
688
+ },
271
689
  "published": {
272
- "description": "发布时间口径:T-0(当天)/ T-1(昨天)/ T-7(近7天)",
690
+ "description": "发布时间口径(相对,支持按天或按分钟);触发时按 task_time 折算成绝对时间区间",
273
691
  "title": "Published",
274
692
  "type": "string"
275
693
  },
694
+ "idate": {
695
+ "anyOf": [
696
+ {
697
+ "type": "string"
698
+ },
699
+ {
700
+ "type": "null"
701
+ }
702
+ ],
703
+ "description": "入库时间口径(相对,按天或按分钟);null=该维度不过滤",
704
+ "title": "Idate"
705
+ },
706
+ "udate": {
707
+ "anyOf": [
708
+ {
709
+ "type": "string"
710
+ },
711
+ {
712
+ "type": "null"
713
+ }
714
+ ],
715
+ "description": "更新时间口径(相对,按天或按分钟);null=该维度不过滤",
716
+ "title": "Udate"
717
+ },
276
718
  "fields": {
277
- "description": "拉取/导出字段(空=全量)",
719
+ "description": "_id 自动输出,禁止在 fields 中填写;拉取/导出字段(空=全量)",
278
720
  "items": {
279
721
  "type": "string"
280
722
  },
281
723
  "title": "Fields",
282
724
  "type": "array"
283
725
  },
726
+ "size": {
727
+ "description": "每次执行最多导出的记录行数;普通批量保存时按系统配置校验,只取前 N 条时上限 10000",
728
+ "title": "Size",
729
+ "type": "integer"
730
+ },
731
+ "top": {
732
+ "anyOf": [
733
+ {
734
+ "items": {
735
+ "additionalProperties": true,
736
+ "type": "object"
737
+ },
738
+ "type": "array"
739
+ },
740
+ {
741
+ "type": "null"
742
+ }
743
+ ],
744
+ "default": null,
745
+ "description": "只取前 N 条的排序定义 [{field, order}];null = 给命中条件的全部数据。非 null 时每次执行只取按该排序排在前 size 条的数据",
746
+ "title": "Top"
747
+ },
284
748
  "frequency": {
285
749
  "description": "自然语言频率",
286
750
  "title": "Frequency",
@@ -292,7 +756,7 @@
292
756
  "type": "string"
293
757
  },
294
758
  "target_type": {
295
- "description": "投递类型:octo(本期)/sftp/kafka",
759
+ "description": "投递类型:octo、sftp、kafka(暂不支持)",
296
760
  "title": "Target Type",
297
761
  "type": "string"
298
762
  },
@@ -324,7 +788,10 @@
324
788
  "rule_ids",
325
789
  "source",
326
790
  "published",
791
+ "idate",
792
+ "udate",
327
793
  "fields",
794
+ "size",
328
795
  "frequency",
329
796
  "cron",
330
797
  "target_type",
@@ -337,33 +804,61 @@
337
804
  "type": "object"
338
805
  },
339
806
  "flags": [
807
+ {
808
+ "flag": "--source",
809
+ "field": "source",
810
+ "type": "list[str](json)",
811
+ "required": false,
812
+ "desc": "历史热门站点中文名数组,取 list_source;与 platform_site 必须二选一"
813
+ },
814
+ {
815
+ "flag": "--platform-site",
816
+ "field": "platform_site",
817
+ "type": "list[object](json)",
818
+ "required": false,
819
+ "desc": "元数据平台站点组合;platform 取 list_platforms.name_en,sites 取 list_sites.value;与 source 二选一"
820
+ },
821
+ {
822
+ "flag": "--confirmed",
823
+ "field": "confirmed",
824
+ "type": "boolean",
825
+ "required": false,
826
+ "desc": "是否已确认继续并同意系统超限处理规则;超量时默认拒绝,true 允许保存但仍按上限截断;不跳过其他校验,不保存到 job,TopN 不适用"
827
+ },
340
828
  {
341
829
  "flag": "--name",
342
830
  "field": "name",
343
831
  "type": "string",
344
832
  "required": true,
345
- "desc": "job 名称,全局唯一"
833
+ "desc": "job 名称,同一凭证(token)下唯一"
346
834
  },
347
835
  {
348
836
  "flag": "--rule-ids",
349
837
  "field": "rule_ids",
350
- "type": "list[str]",
838
+ "type": "list[str](json)",
351
839
  "required": true,
352
840
  "desc": "魔方规则ID数组,至少 1 个"
353
841
  },
354
- {
355
- "flag": "--source",
356
- "field": "source",
357
- "type": "list[str]",
358
- "required": true,
359
- "desc": "站点数组,至少 1 个;只能取已配置站点"
360
- },
361
842
  {
362
843
  "flag": "--published",
363
844
  "field": "published",
364
- "type": "enum(T-0、T-1、T-7)",
845
+ "type": "string",
365
846
  "required": true,
366
- "desc": "发布时间口径:T-0(当天)/ T-1(昨天)/ T-7(近7天到昨天)"
847
+ "desc": "**发布时间**口径(必填,主口径 —— 它同时决定查哪个月的索引、怎么拆分片,所以不能缺省)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。"
848
+ },
849
+ {
850
+ "flag": "--idate",
851
+ "field": "idate",
852
+ "type": "string",
853
+ "required": false,
854
+ "desc": "**入库时间**口径(选填,不传=该维度不过滤)。在发布时间窗**之内**再 AND 一层:入库时间落在本区间的数据。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。"
855
+ },
856
+ {
857
+ "flag": "--udate",
858
+ "field": "udate",
859
+ "type": "string",
860
+ "required": false,
861
+ "desc": "**更新时间**口径(选填,不传=该维度不过滤)。在发布时间窗**之内**再 AND 一层:更新时间落在本区间的数据。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。"
367
862
  },
368
863
  {
369
864
  "flag": "--frequency",
@@ -375,16 +870,30 @@
375
870
  {
376
871
  "flag": "--fields",
377
872
  "field": "fields",
378
- "type": "list[str]",
873
+ "type": "list[str](json)",
874
+ "required": false,
875
+ "desc": "_id 自动输出,禁止在 fields 中填写;拉取/导出字段;不填拉全量"
876
+ },
877
+ {
878
+ "flag": "--size",
879
+ "field": "size",
880
+ "type": "integer",
379
881
  "required": false,
380
- "desc": "拉取/导出字段;不填拉全量"
882
+ "desc": "每次执行最多导出的记录行数。省略则按模式取默认:普通批量默认最多 500000 条,实际以服务端当前约束为准;传了 top(只取前 N 条)则默认 1,000、上限 10,000"
381
883
  },
382
884
  {
383
885
  "flag": "--target",
384
886
  "field": "target",
385
887
  "type": "object(json)",
386
888
  "required": false,
387
- "desc": "投递目标;省略默认 octo(excel)。本期仅接受 octo"
889
+ "desc": "投递目标;省略默认 octo(json)。本期支持 octo(上传存储→CDN url)与 sftp(账密上传远端,路径/文件名可用日期变量);kafka: 暂未实现。"
890
+ },
891
+ {
892
+ "flag": "--top",
893
+ "field": "top",
894
+ "type": "list[object](json)",
895
+ "required": false,
896
+ "desc": "只取前 N 条(可选)。**不改变筛选条件** —— 省略时给命中条件的全部数据,传了则在同一批命中结果里按指定字段排序、只取前 size 条。排序跨发布窗内所有日期 / 站点 / 规则**全局生效**(不是每天各取 N)。多字段按顺序作排序优先级(前者相同时比后者)。字段必须是可排序类型(keyword / long / double / date)。该模式下 size 默认 1,000、最大 10,000;且多条规则改为 OR 合并并去重,导出的 kw_ruleId 恒为 topN、无法区分来源规则"
388
897
  }
389
898
  ],
390
899
  "transport": {
@@ -496,17 +1005,149 @@
496
1005
  },
497
1006
  "output_schema": {
498
1007
  "$defs": {
1008
+ "PlatformSite": {
1009
+ "additionalProperties": false,
1010
+ "properties": {
1011
+ "platform": {
1012
+ "description": "具体平台编码,禁止包含 *,取 list_platforms 的 name_en;全平台须逐一列出平台组合",
1013
+ "minLength": 1,
1014
+ "pattern": "^[^*]+$",
1015
+ "title": "Platform",
1016
+ "type": "string"
1017
+ },
1018
+ "sites": {
1019
+ "description": "站点编码数组,取 list_sites 的 value;[\"*\"] 表示该平台全部站点,不可混用",
1020
+ "items": {
1021
+ "minLength": 1,
1022
+ "type": "string"
1023
+ },
1024
+ "minItems": 1,
1025
+ "title": "Sites",
1026
+ "type": "array"
1027
+ }
1028
+ },
1029
+ "required": [
1030
+ "platform",
1031
+ "sites"
1032
+ ],
1033
+ "title": "PlatformSite",
1034
+ "type": "object"
1035
+ },
1036
+ "PrecheckResult": {
1037
+ "additionalProperties": false,
1038
+ "properties": {
1039
+ "checked_at": {
1040
+ "description": "检查时间,东八区 ISO 时间",
1041
+ "title": "Checked At",
1042
+ "type": "string"
1043
+ },
1044
+ "windows": {
1045
+ "additionalProperties": {
1046
+ "anyOf": [
1047
+ {
1048
+ "type": "string"
1049
+ },
1050
+ {
1051
+ "type": "null"
1052
+ }
1053
+ ]
1054
+ },
1055
+ "description": "发布时间、入库时间、更新时间三个维度的绝对闭区间;空表示不过滤",
1056
+ "title": "Windows",
1057
+ "type": "object"
1058
+ },
1059
+ "matched_rows": {
1060
+ "description": "命中行数;count_relation=gte 时为下界,非精确总量",
1061
+ "title": "Matched Rows",
1062
+ "type": "integer"
1063
+ },
1064
+ "count_relation": {
1065
+ "description": "eq=精确计数;gte=至少命中该数量",
1066
+ "enum": [
1067
+ "eq",
1068
+ "gte"
1069
+ ],
1070
+ "title": "Count Relation",
1071
+ "type": "string"
1072
+ },
1073
+ "system_limit": {
1074
+ "anyOf": [
1075
+ {
1076
+ "type": "integer"
1077
+ },
1078
+ {
1079
+ "type": "null"
1080
+ }
1081
+ ],
1082
+ "description": "普通批量的系统导出上限;TopN 未执行预检时为空",
1083
+ "title": "System Limit"
1084
+ },
1085
+ "effective_limit": {
1086
+ "description": "本次生效的单次最大导出行数",
1087
+ "title": "Effective Limit",
1088
+ "type": "integer"
1089
+ },
1090
+ "would_truncate": {
1091
+ "description": "当前统计是否超出有效导出数量;TopN 不新增预检",
1092
+ "title": "Would Truncate",
1093
+ "type": "boolean"
1094
+ },
1095
+ "checked": {
1096
+ "default": true,
1097
+ "description": "是否执行数据量统计;TopN 为 false",
1098
+ "title": "Checked",
1099
+ "type": "boolean"
1100
+ },
1101
+ "message": {
1102
+ "description": "数量提示及调整参数或确认继续的说明",
1103
+ "title": "Message",
1104
+ "type": "string"
1105
+ }
1106
+ },
1107
+ "required": [
1108
+ "checked_at",
1109
+ "windows",
1110
+ "matched_rows",
1111
+ "count_relation",
1112
+ "system_limit",
1113
+ "effective_limit",
1114
+ "would_truncate",
1115
+ "message"
1116
+ ],
1117
+ "title": "PrecheckResult",
1118
+ "type": "object"
1119
+ },
499
1120
  "SubJob": {
500
1121
  "additionalProperties": false,
501
1122
  "description": "订阅 job 出参对象。",
502
1123
  "properties": {
1124
+ "precheck": {
1125
+ "anyOf": [
1126
+ {
1127
+ "$ref": "#/$defs/PrecheckResult"
1128
+ },
1129
+ {
1130
+ "type": "null"
1131
+ }
1132
+ ],
1133
+ "default": null,
1134
+ "description": "本次保存的数据量预检摘要;非预检场景为空,不保存到 job"
1135
+ },
1136
+ "warnings": {
1137
+ "description": "本次保存的超量截断提醒;未超量为空,不保存到 job",
1138
+ "items": {
1139
+ "type": "string"
1140
+ },
1141
+ "title": "Warnings",
1142
+ "type": "array"
1143
+ },
503
1144
  "job_id": {
504
1145
  "description": "job ID",
505
1146
  "title": "Job Id",
506
1147
  "type": "integer"
507
1148
  },
508
1149
  "name": {
509
- "description": "job 名称,全局唯一",
1150
+ "description": "job 名称,同一凭证(token)下唯一",
510
1151
  "title": "Name",
511
1152
  "type": "string"
512
1153
  },
@@ -519,26 +1160,88 @@
519
1160
  "type": "array"
520
1161
  },
521
1162
  "source": {
522
- "description": "站点数组",
1163
+ "description": "历史热门站点中文名数组;元数据模式为空数组",
523
1164
  "items": {
524
1165
  "type": "string"
525
1166
  },
526
1167
  "title": "Source",
527
1168
  "type": "array"
528
1169
  },
1170
+ "platform_site": {
1171
+ "anyOf": [
1172
+ {
1173
+ "items": {
1174
+ "$ref": "#/$defs/PlatformSite"
1175
+ },
1176
+ "type": "array"
1177
+ },
1178
+ {
1179
+ "type": "null"
1180
+ }
1181
+ ],
1182
+ "default": null,
1183
+ "description": "元数据平台站点组合;历史热门站点模式为 null",
1184
+ "title": "Platform Site"
1185
+ },
529
1186
  "published": {
530
- "description": "发布时间口径:T-0(当天)/ T-1(昨天)/ T-7(近7天)",
1187
+ "description": "发布时间口径(相对,支持按天或按分钟);触发时按 task_time 折算成绝对时间区间",
531
1188
  "title": "Published",
532
1189
  "type": "string"
533
1190
  },
1191
+ "idate": {
1192
+ "anyOf": [
1193
+ {
1194
+ "type": "string"
1195
+ },
1196
+ {
1197
+ "type": "null"
1198
+ }
1199
+ ],
1200
+ "description": "入库时间口径(相对,按天或按分钟);null=该维度不过滤",
1201
+ "title": "Idate"
1202
+ },
1203
+ "udate": {
1204
+ "anyOf": [
1205
+ {
1206
+ "type": "string"
1207
+ },
1208
+ {
1209
+ "type": "null"
1210
+ }
1211
+ ],
1212
+ "description": "更新时间口径(相对,按天或按分钟);null=该维度不过滤",
1213
+ "title": "Udate"
1214
+ },
534
1215
  "fields": {
535
- "description": "拉取/导出字段(空=全量)",
1216
+ "description": "_id 自动输出,禁止在 fields 中填写;拉取/导出字段(空=全量)",
536
1217
  "items": {
537
1218
  "type": "string"
538
1219
  },
539
1220
  "title": "Fields",
540
1221
  "type": "array"
541
1222
  },
1223
+ "size": {
1224
+ "description": "每次执行最多导出的记录行数;普通批量保存时按系统配置校验,只取前 N 条时上限 10000",
1225
+ "title": "Size",
1226
+ "type": "integer"
1227
+ },
1228
+ "top": {
1229
+ "anyOf": [
1230
+ {
1231
+ "items": {
1232
+ "additionalProperties": true,
1233
+ "type": "object"
1234
+ },
1235
+ "type": "array"
1236
+ },
1237
+ {
1238
+ "type": "null"
1239
+ }
1240
+ ],
1241
+ "default": null,
1242
+ "description": "只取前 N 条的排序定义 [{field, order}];null = 给命中条件的全部数据。非 null 时每次执行只取按该排序排在前 size 条的数据",
1243
+ "title": "Top"
1244
+ },
542
1245
  "frequency": {
543
1246
  "description": "自然语言频率",
544
1247
  "title": "Frequency",
@@ -550,7 +1253,7 @@
550
1253
  "type": "string"
551
1254
  },
552
1255
  "target_type": {
553
- "description": "投递类型:octo(本期)/sftp/kafka",
1256
+ "description": "投递类型:octo、sftp、kafka(暂不支持)",
554
1257
  "title": "Target Type",
555
1258
  "type": "string"
556
1259
  },
@@ -582,7 +1285,10 @@
582
1285
  "rule_ids",
583
1286
  "source",
584
1287
  "published",
1288
+ "idate",
1289
+ "udate",
585
1290
  "fields",
1291
+ "size",
586
1292
  "frequency",
587
1293
  "cron",
588
1294
  "target_type",
@@ -645,7 +1351,7 @@
645
1351
  "op": "job_trigger",
646
1352
  "name": "subscription/job_trigger",
647
1353
  "summary": "临时触发一次本人 job,落一条 ik_subscription_task(manual);默认用 job 存的 target,可覆盖。",
648
- "description": "临时触发一次本人 job,落一条 ik_subscription_task(manual);默认用 job 存的 target,可覆盖。\n\n落 pending task 后触发 Airflow DAG(``social_neuron_subscription``)跑取数→组装→投递(上传取 url);\n未配 airflow_base_url 时(本地/测试)触发被跳过,仅留 pending task。**无通知**:结果落\n``file_info.url``,调用方轮询 ``task-list`` 拉取。",
1354
+ "description": "临时触发一次本人 job,落一条 ik_subscription_task(manual);默认用 job 存的 target,可覆盖。\n\n落 pending task 后触发 Airflow DAG(``social_capability_subscription``)\n跑取数→组装→投递(上传取 url);\n未配 airflow_base_url 时(本地/测试)触发被跳过,仅留 pending task。**无通知**:结果落\n``file_info.url``,调用方轮询 ``task-list`` 拉取。",
649
1355
  "input_schema": {
650
1356
  "$defs": {
651
1357
  "KafkaTarget": {
@@ -720,7 +1426,7 @@
720
1426
  },
721
1427
  "SftpTarget": {
722
1428
  "additionalProperties": false,
723
- "description": "sftp(本期):把导出文件上传到 SFTP 远端目录。",
1429
+ "description": "sftp(本期):把导出文件上传到 SFTP 远端目录。\n目录与文件名都支持日期变量 ``yyyyMMdd`` / ``yyyyMM`` / ``yyyy``,同一个 task\n重跑多少次,远端路径与文件名都不变。",
724
1430
  "properties": {
725
1431
  "type": {
726
1432
  "const": "sftp",
@@ -729,31 +1435,49 @@
729
1435
  "type": "string"
730
1436
  },
731
1437
  "host": {
732
- "description": "SFTP 主机",
1438
+ "description": "SFTP 主机,不能为空白",
1439
+ "minLength": 1,
733
1440
  "title": "Host",
734
1441
  "type": "string"
735
1442
  },
736
1443
  "port": {
737
1444
  "default": 22,
738
- "description": "端口,默认 22",
1445
+ "description": "端口,1–65535,默认 22",
1446
+ "maximum": 65535,
1447
+ "minimum": 1,
739
1448
  "title": "Port",
740
1449
  "type": "integer"
741
1450
  },
742
1451
  "username": {
743
- "description": "登录用户名",
1452
+ "description": "登录用户名,不能为空白",
1453
+ "minLength": 1,
744
1454
  "title": "Username",
745
1455
  "type": "string"
746
1456
  },
747
1457
  "password": {
748
- "description": "登录密码",
1458
+ "description": "登录密码,不能为空白,保留首尾空格",
1459
+ "minLength": 1,
749
1460
  "title": "Password",
750
1461
  "type": "string"
751
1462
  },
752
1463
  "remote_path": {
753
- "description": "远端目录/路径",
1464
+ "description": "远端目录/路径。可在**任意一层**用日期变量,但变量必须**独占一层**:`/data/sub/yyyyMM/yyyyMMdd` 合法,`/data/sub_yyyyMMdd` 非法。只认 yyyyMMdd / yyyyMM / yyyy 三种;不允许 '..'、空目录层。",
754
1465
  "title": "Remote Path",
755
1466
  "type": "string"
756
1467
  },
1468
+ "filename_template": {
1469
+ "anyOf": [
1470
+ {
1471
+ "type": "string"
1472
+ },
1473
+ {
1474
+ "type": "null"
1475
+ }
1476
+ ],
1477
+ "default": null,
1478
+ "description": "自定义文件名模板(不含扩展名)。只允许字母、数字、'_'、'-' 与日期变量,且变量前后必须是 '_' 或首尾:`daily_yyyyMMdd_export`、`yyyyMM_summary` 合法,`dailyyyyyMMdd`、`report-yyyyMMdd-x` 非法。系统统一追加 `_<task_id>` 与扩展名。不传=沿用默认 `<job_id>_<task_id>.<ext>`。",
1479
+ "title": "Filename Template"
1480
+ },
757
1481
  "format": {
758
1482
  "default": "json",
759
1483
  "description": "文件格式:csv/excel/json(默认 json)",
@@ -787,6 +1511,7 @@
787
1511
  "start_time": {
788
1512
  "anyOf": [
789
1513
  {
1514
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
790
1515
  "type": "string"
791
1516
  },
792
1517
  {
@@ -794,12 +1519,13 @@
794
1519
  }
795
1520
  ],
796
1521
  "default": null,
797
- "description": "回溯起始;与 end_time 同传同不传",
1522
+ "description": "**发布时间**闭区间下界(东八区)。支持 yyyy-MM-dd(整日)、yyyy-MM-ddTHH:mm(整分钟);与 end_time 同传同不传;不传则按 job 上的 published 相对口径折算",
798
1523
  "title": "Start Time"
799
1524
  },
800
1525
  "end_time": {
801
1526
  "anyOf": [
802
1527
  {
1528
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
803
1529
  "type": "string"
804
1530
  },
805
1531
  {
@@ -807,9 +1533,65 @@
807
1533
  }
808
1534
  ],
809
1535
  "default": null,
810
- "description": "回溯结束",
1536
+ "description": "**发布时间**闭区间上界(东八区,精度须与下界一致);日期包含整日,分钟包含整分钟",
811
1537
  "title": "End Time"
812
1538
  },
1539
+ "idate_start": {
1540
+ "anyOf": [
1541
+ {
1542
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
1543
+ "type": "string"
1544
+ },
1545
+ {
1546
+ "type": "null"
1547
+ }
1548
+ ],
1549
+ "default": null,
1550
+ "description": "**入库时间**闭区间下界(东八区,支持日期/分钟);与 idate_end 同传同不传;不传则按 job 上的 idate 相对口径折算,job 也没配=该维度不过滤",
1551
+ "title": "Idate Start"
1552
+ },
1553
+ "idate_end": {
1554
+ "anyOf": [
1555
+ {
1556
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
1557
+ "type": "string"
1558
+ },
1559
+ {
1560
+ "type": "null"
1561
+ }
1562
+ ],
1563
+ "default": null,
1564
+ "description": "本次**入库时间**闭区间上界(东八区,精度须与下界一致)",
1565
+ "title": "Idate End"
1566
+ },
1567
+ "udate_start": {
1568
+ "anyOf": [
1569
+ {
1570
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
1571
+ "type": "string"
1572
+ },
1573
+ {
1574
+ "type": "null"
1575
+ }
1576
+ ],
1577
+ "default": null,
1578
+ "description": "**更新时间**闭区间下界(东八区,支持日期/分钟);与 udate_end 同传同不传;不传则按 job 上的 udate 相对口径折算,job 也没配=该维度不过滤",
1579
+ "title": "Udate Start"
1580
+ },
1581
+ "udate_end": {
1582
+ "anyOf": [
1583
+ {
1584
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
1585
+ "type": "string"
1586
+ },
1587
+ {
1588
+ "type": "null"
1589
+ }
1590
+ ],
1591
+ "default": null,
1592
+ "description": "**更新时间**闭区间上界(东八区,精度须与下界一致)",
1593
+ "title": "Udate End"
1594
+ },
813
1595
  "target": {
814
1596
  "anyOf": [
815
1597
  {
@@ -840,12 +1622,27 @@
840
1622
  "default": null,
841
1623
  "description": "覆盖本次投递目标",
842
1624
  "title": "Target"
843
- }
844
- },
845
- "required": [
846
- "job_id"
847
- ],
848
- "title": "SubJobTriggerInput",
1625
+ },
1626
+ "size": {
1627
+ "anyOf": [
1628
+ {
1629
+ "maximum": 2147483647,
1630
+ "minimum": 1,
1631
+ "type": "integer"
1632
+ },
1633
+ {
1634
+ "type": "null"
1635
+ }
1636
+ ],
1637
+ "default": null,
1638
+ "description": "覆盖本次导出行数;不传继承 job.size 并按系统当前上限收紧,显式超限拒绝",
1639
+ "title": "Size"
1640
+ }
1641
+ },
1642
+ "required": [
1643
+ "job_id"
1644
+ ],
1645
+ "title": "SubJobTriggerInput",
849
1646
  "type": "object"
850
1647
  },
851
1648
  "output_schema": {
@@ -882,14 +1679,42 @@
882
1679
  "field": "start_time",
883
1680
  "type": "string",
884
1681
  "required": false,
885
- "desc": "回溯起始;与 end_time 同传同不传"
1682
+ "desc": "**发布时间**闭区间下界(东八区)。支持 yyyy-MM-dd(整日)、yyyy-MM-ddTHH:mm(整分钟);与 end_time 同传同不传;不传则按 job 上的 published 相对口径折算"
886
1683
  },
887
1684
  {
888
1685
  "flag": "--end-time",
889
1686
  "field": "end_time",
890
1687
  "type": "string",
891
1688
  "required": false,
892
- "desc": "回溯结束"
1689
+ "desc": "**发布时间**闭区间上界(东八区,精度须与下界一致);日期包含整日,分钟包含整分钟"
1690
+ },
1691
+ {
1692
+ "flag": "--idate-start",
1693
+ "field": "idate_start",
1694
+ "type": "string",
1695
+ "required": false,
1696
+ "desc": "**入库时间**闭区间下界(东八区,支持日期/分钟);与 idate_end 同传同不传;不传则按 job 上的 idate 相对口径折算,job 也没配=该维度不过滤"
1697
+ },
1698
+ {
1699
+ "flag": "--idate-end",
1700
+ "field": "idate_end",
1701
+ "type": "string",
1702
+ "required": false,
1703
+ "desc": "本次**入库时间**闭区间上界(东八区,精度须与下界一致)"
1704
+ },
1705
+ {
1706
+ "flag": "--udate-start",
1707
+ "field": "udate_start",
1708
+ "type": "string",
1709
+ "required": false,
1710
+ "desc": "**更新时间**闭区间下界(东八区,支持日期/分钟);与 udate_end 同传同不传;不传则按 job 上的 udate 相对口径折算,job 也没配=该维度不过滤"
1711
+ },
1712
+ {
1713
+ "flag": "--udate-end",
1714
+ "field": "udate_end",
1715
+ "type": "string",
1716
+ "required": false,
1717
+ "desc": "**更新时间**闭区间上界(东八区,精度须与下界一致)"
893
1718
  },
894
1719
  {
895
1720
  "flag": "--target",
@@ -897,6 +1722,13 @@
897
1722
  "type": "object(json)",
898
1723
  "required": false,
899
1724
  "desc": "覆盖本次投递目标"
1725
+ },
1726
+ {
1727
+ "flag": "--size",
1728
+ "field": "size",
1729
+ "type": "integer",
1730
+ "required": false,
1731
+ "desc": "覆盖本次导出行数;不传继承 job.size 并按系统当前上限收紧,显式超限拒绝"
900
1732
  }
901
1733
  ],
902
1734
  "transport": {
@@ -990,9 +1822,37 @@
990
1822
  "title": "OctoTarget",
991
1823
  "type": "object"
992
1824
  },
1825
+ "PlatformSite": {
1826
+ "additionalProperties": false,
1827
+ "properties": {
1828
+ "platform": {
1829
+ "description": "具体平台编码,禁止包含 *,取 list_platforms 的 name_en;全平台须逐一列出平台组合",
1830
+ "minLength": 1,
1831
+ "pattern": "^[^*]+$",
1832
+ "title": "Platform",
1833
+ "type": "string"
1834
+ },
1835
+ "sites": {
1836
+ "description": "站点编码数组,取 list_sites 的 value;[\"*\"] 表示该平台全部站点,不可混用",
1837
+ "items": {
1838
+ "minLength": 1,
1839
+ "type": "string"
1840
+ },
1841
+ "minItems": 1,
1842
+ "title": "Sites",
1843
+ "type": "array"
1844
+ }
1845
+ },
1846
+ "required": [
1847
+ "platform",
1848
+ "sites"
1849
+ ],
1850
+ "title": "PlatformSite",
1851
+ "type": "object"
1852
+ },
993
1853
  "SftpTarget": {
994
1854
  "additionalProperties": false,
995
- "description": "sftp(本期):把导出文件上传到 SFTP 远端目录。",
1855
+ "description": "sftp(本期):把导出文件上传到 SFTP 远端目录。\n目录与文件名都支持日期变量 ``yyyyMMdd`` / ``yyyyMM`` / ``yyyy``,同一个 task\n重跑多少次,远端路径与文件名都不变。",
996
1856
  "properties": {
997
1857
  "type": {
998
1858
  "const": "sftp",
@@ -1001,31 +1861,49 @@
1001
1861
  "type": "string"
1002
1862
  },
1003
1863
  "host": {
1004
- "description": "SFTP 主机",
1864
+ "description": "SFTP 主机,不能为空白",
1865
+ "minLength": 1,
1005
1866
  "title": "Host",
1006
1867
  "type": "string"
1007
1868
  },
1008
1869
  "port": {
1009
1870
  "default": 22,
1010
- "description": "端口,默认 22",
1871
+ "description": "端口,1–65535,默认 22",
1872
+ "maximum": 65535,
1873
+ "minimum": 1,
1011
1874
  "title": "Port",
1012
1875
  "type": "integer"
1013
1876
  },
1014
1877
  "username": {
1015
- "description": "登录用户名",
1878
+ "description": "登录用户名,不能为空白",
1879
+ "minLength": 1,
1016
1880
  "title": "Username",
1017
1881
  "type": "string"
1018
1882
  },
1019
1883
  "password": {
1020
- "description": "登录密码",
1884
+ "description": "登录密码,不能为空白,保留首尾空格",
1885
+ "minLength": 1,
1021
1886
  "title": "Password",
1022
1887
  "type": "string"
1023
1888
  },
1024
1889
  "remote_path": {
1025
- "description": "远端目录/路径",
1890
+ "description": "远端目录/路径。可在**任意一层**用日期变量,但变量必须**独占一层**:`/data/sub/yyyyMM/yyyyMMdd` 合法,`/data/sub_yyyyMMdd` 非法。只认 yyyyMMdd / yyyyMM / yyyy 三种;不允许 '..'、空目录层。",
1026
1891
  "title": "Remote Path",
1027
1892
  "type": "string"
1028
1893
  },
1894
+ "filename_template": {
1895
+ "anyOf": [
1896
+ {
1897
+ "type": "string"
1898
+ },
1899
+ {
1900
+ "type": "null"
1901
+ }
1902
+ ],
1903
+ "default": null,
1904
+ "description": "自定义文件名模板(不含扩展名)。只允许字母、数字、'_'、'-' 与日期变量,且变量前后必须是 '_' 或首尾:`daily_yyyyMMdd_export`、`yyyyMM_summary` 合法,`dailyyyyyMMdd`、`report-yyyyMMdd-x` 非法。系统统一追加 `_<task_id>` 与扩展名。不传=沿用默认 `<job_id>_<task_id>.<ext>`。",
1905
+ "title": "Filename Template"
1906
+ },
1029
1907
  "format": {
1030
1908
  "default": "json",
1031
1909
  "description": "文件格式:csv/excel/json(默认 json)",
@@ -1047,10 +1925,42 @@
1047
1925
  ],
1048
1926
  "title": "SftpTarget",
1049
1927
  "type": "object"
1928
+ },
1929
+ "TopSpec": {
1930
+ "additionalProperties": false,
1931
+ "description": "全局TopN排序规格(subscription专用)。",
1932
+ "properties": {
1933
+ "field": {
1934
+ "description": "排序字段(name_en);仅支持可排序类型(keyword/long/double/date)",
1935
+ "title": "Field",
1936
+ "type": "string"
1937
+ },
1938
+ "order": {
1939
+ "default": "desc",
1940
+ "description": "排序方向:desc降序(取最大的N个)/asc升序(取最小的N个)",
1941
+ "enum": [
1942
+ "asc",
1943
+ "desc"
1944
+ ],
1945
+ "title": "Order",
1946
+ "type": "string"
1947
+ }
1948
+ },
1949
+ "required": [
1950
+ "field"
1951
+ ],
1952
+ "title": "TopSpec",
1953
+ "type": "object"
1050
1954
  }
1051
1955
  },
1052
1956
  "additionalProperties": false,
1053
1957
  "properties": {
1958
+ "confirmed": {
1959
+ "default": false,
1960
+ "description": "是否已确认继续并同意系统超限处理规则;修改取数配置超量时默认拒绝,true 允许保存但仍按上限截断;仅本次有效,TopN 不适用",
1961
+ "title": "Confirmed",
1962
+ "type": "boolean"
1963
+ },
1054
1964
  "job_id": {
1055
1965
  "description": "目标 job",
1056
1966
  "title": "Job Id",
@@ -1068,7 +1978,7 @@
1068
1978
  }
1069
1979
  ],
1070
1980
  "default": null,
1071
- "description": "新名称(全局唯一)",
1981
+ "description": "新名称(同一凭证下唯一)",
1072
1982
  "title": "Name"
1073
1983
  },
1074
1984
  "rule_ids": {
@@ -1104,17 +2014,30 @@
1104
2014
  }
1105
2015
  ],
1106
2016
  "default": null,
1107
- "description": "整组全量覆盖",
2017
+ "description": "历史热门站点中文名数组,取 list_source;整体替换范围,与 platform_site 互斥",
1108
2018
  "title": "Source"
1109
2019
  },
2020
+ "platform_site": {
2021
+ "anyOf": [
2022
+ {
2023
+ "items": {
2024
+ "$ref": "#/$defs/PlatformSite"
2025
+ },
2026
+ "minItems": 1,
2027
+ "type": "array"
2028
+ },
2029
+ {
2030
+ "type": "null"
2031
+ }
2032
+ ],
2033
+ "default": null,
2034
+ "description": "元数据平台站点组合;整体替换范围,与 source 互斥;不传保持原范围",
2035
+ "title": "Platform Site"
2036
+ },
1110
2037
  "published": {
1111
2038
  "anyOf": [
1112
2039
  {
1113
- "enum": [
1114
- "T-0",
1115
- "T-1",
1116
- "T-7"
1117
- ],
2040
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)$",
1118
2041
  "type": "string"
1119
2042
  },
1120
2043
  {
@@ -1122,9 +2045,37 @@
1122
2045
  }
1123
2046
  ],
1124
2047
  "default": null,
1125
- "description": "发布时间口径:T-0 / T-1 / T-7",
2048
+ "description": "**发布时间**口径(必填字段,只能改不能清)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
1126
2049
  "title": "Published"
1127
2050
  },
2051
+ "idate": {
2052
+ "anyOf": [
2053
+ {
2054
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
2055
+ "type": "string"
2056
+ },
2057
+ {
2058
+ "type": "null"
2059
+ }
2060
+ ],
2061
+ "default": null,
2062
+ "description": "**入库时间**口径。不传=不改;传空串 \"\"=**清除**该维度(恢复成不过滤)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
2063
+ "title": "Idate"
2064
+ },
2065
+ "udate": {
2066
+ "anyOf": [
2067
+ {
2068
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
2069
+ "type": "string"
2070
+ },
2071
+ {
2072
+ "type": "null"
2073
+ }
2074
+ ],
2075
+ "default": null,
2076
+ "description": "**更新时间**口径。不传=不改;传空串 \"\"=**清除**该维度(恢复成不过滤)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
2077
+ "title": "Udate"
2078
+ },
1128
2079
  "fields": {
1129
2080
  "anyOf": [
1130
2081
  {
@@ -1139,9 +2090,24 @@
1139
2090
  }
1140
2091
  ],
1141
2092
  "default": null,
1142
- "description": "整组全量覆盖",
2093
+ "description": "业务字段整组全量覆盖;_id 自动输出,禁止在 fields 中填写",
1143
2094
  "title": "Fields"
1144
2095
  },
2096
+ "size": {
2097
+ "anyOf": [
2098
+ {
2099
+ "maximum": 2147483647,
2100
+ "minimum": 1,
2101
+ "type": "integer"
2102
+ },
2103
+ {
2104
+ "type": "null"
2105
+ }
2106
+ ],
2107
+ "default": null,
2108
+ "description": "每次执行最多导出的记录行数;不传则不修改,普通批量默认上限 500000,TopN 默认上限 10000,实际以上游返回约束为准",
2109
+ "title": "Size"
2110
+ },
1145
2111
  "frequency": {
1146
2112
  "anyOf": [
1147
2113
  {
@@ -1188,6 +2154,22 @@
1188
2154
  "description": "整体替换投递目标",
1189
2155
  "title": "Target"
1190
2156
  },
2157
+ "top": {
2158
+ "anyOf": [
2159
+ {
2160
+ "items": {
2161
+ "$ref": "#/$defs/TopSpec"
2162
+ },
2163
+ "type": "array"
2164
+ },
2165
+ {
2166
+ "type": "null"
2167
+ }
2168
+ ],
2169
+ "default": null,
2170
+ "description": "只取前 N 条的排序规格:传入则整组替换,不传则不修改。切到该模式后 size 最大 10,000;传空数组 [] 表示改回「给全部命中数据」",
2171
+ "title": "Top"
2172
+ },
1191
2173
  "active": {
1192
2174
  "anyOf": [
1193
2175
  {
@@ -1213,16 +2195,150 @@
1213
2195
  "type": "object"
1214
2196
  },
1215
2197
  "output_schema": {
2198
+ "$defs": {
2199
+ "PlatformSite": {
2200
+ "additionalProperties": false,
2201
+ "properties": {
2202
+ "platform": {
2203
+ "description": "具体平台编码,禁止包含 *,取 list_platforms 的 name_en;全平台须逐一列出平台组合",
2204
+ "minLength": 1,
2205
+ "pattern": "^[^*]+$",
2206
+ "title": "Platform",
2207
+ "type": "string"
2208
+ },
2209
+ "sites": {
2210
+ "description": "站点编码数组,取 list_sites 的 value;[\"*\"] 表示该平台全部站点,不可混用",
2211
+ "items": {
2212
+ "minLength": 1,
2213
+ "type": "string"
2214
+ },
2215
+ "minItems": 1,
2216
+ "title": "Sites",
2217
+ "type": "array"
2218
+ }
2219
+ },
2220
+ "required": [
2221
+ "platform",
2222
+ "sites"
2223
+ ],
2224
+ "title": "PlatformSite",
2225
+ "type": "object"
2226
+ },
2227
+ "PrecheckResult": {
2228
+ "additionalProperties": false,
2229
+ "properties": {
2230
+ "checked_at": {
2231
+ "description": "检查时间,东八区 ISO 时间",
2232
+ "title": "Checked At",
2233
+ "type": "string"
2234
+ },
2235
+ "windows": {
2236
+ "additionalProperties": {
2237
+ "anyOf": [
2238
+ {
2239
+ "type": "string"
2240
+ },
2241
+ {
2242
+ "type": "null"
2243
+ }
2244
+ ]
2245
+ },
2246
+ "description": "发布时间、入库时间、更新时间三个维度的绝对闭区间;空表示不过滤",
2247
+ "title": "Windows",
2248
+ "type": "object"
2249
+ },
2250
+ "matched_rows": {
2251
+ "description": "命中行数;count_relation=gte 时为下界,非精确总量",
2252
+ "title": "Matched Rows",
2253
+ "type": "integer"
2254
+ },
2255
+ "count_relation": {
2256
+ "description": "eq=精确计数;gte=至少命中该数量",
2257
+ "enum": [
2258
+ "eq",
2259
+ "gte"
2260
+ ],
2261
+ "title": "Count Relation",
2262
+ "type": "string"
2263
+ },
2264
+ "system_limit": {
2265
+ "anyOf": [
2266
+ {
2267
+ "type": "integer"
2268
+ },
2269
+ {
2270
+ "type": "null"
2271
+ }
2272
+ ],
2273
+ "description": "普通批量的系统导出上限;TopN 未执行预检时为空",
2274
+ "title": "System Limit"
2275
+ },
2276
+ "effective_limit": {
2277
+ "description": "本次生效的单次最大导出行数",
2278
+ "title": "Effective Limit",
2279
+ "type": "integer"
2280
+ },
2281
+ "would_truncate": {
2282
+ "description": "当前统计是否超出有效导出数量;TopN 不新增预检",
2283
+ "title": "Would Truncate",
2284
+ "type": "boolean"
2285
+ },
2286
+ "checked": {
2287
+ "default": true,
2288
+ "description": "是否执行数据量统计;TopN 为 false",
2289
+ "title": "Checked",
2290
+ "type": "boolean"
2291
+ },
2292
+ "message": {
2293
+ "description": "数量提示及调整参数或确认继续的说明",
2294
+ "title": "Message",
2295
+ "type": "string"
2296
+ }
2297
+ },
2298
+ "required": [
2299
+ "checked_at",
2300
+ "windows",
2301
+ "matched_rows",
2302
+ "count_relation",
2303
+ "system_limit",
2304
+ "effective_limit",
2305
+ "would_truncate",
2306
+ "message"
2307
+ ],
2308
+ "title": "PrecheckResult",
2309
+ "type": "object"
2310
+ }
2311
+ },
1216
2312
  "additionalProperties": false,
1217
2313
  "description": "订阅 job 出参对象。",
1218
2314
  "properties": {
2315
+ "precheck": {
2316
+ "anyOf": [
2317
+ {
2318
+ "$ref": "#/$defs/PrecheckResult"
2319
+ },
2320
+ {
2321
+ "type": "null"
2322
+ }
2323
+ ],
2324
+ "default": null,
2325
+ "description": "本次保存的数据量预检摘要;非预检场景为空,不保存到 job"
2326
+ },
2327
+ "warnings": {
2328
+ "description": "本次保存的超量截断提醒;未超量为空,不保存到 job",
2329
+ "items": {
2330
+ "type": "string"
2331
+ },
2332
+ "title": "Warnings",
2333
+ "type": "array"
2334
+ },
1219
2335
  "job_id": {
1220
2336
  "description": "job ID",
1221
2337
  "title": "Job Id",
1222
2338
  "type": "integer"
1223
2339
  },
1224
2340
  "name": {
1225
- "description": "job 名称,全局唯一",
2341
+ "description": "job 名称,同一凭证(token)下唯一",
1226
2342
  "title": "Name",
1227
2343
  "type": "string"
1228
2344
  },
@@ -1235,26 +2351,88 @@
1235
2351
  "type": "array"
1236
2352
  },
1237
2353
  "source": {
1238
- "description": "站点数组",
2354
+ "description": "历史热门站点中文名数组;元数据模式为空数组",
1239
2355
  "items": {
1240
2356
  "type": "string"
1241
2357
  },
1242
2358
  "title": "Source",
1243
2359
  "type": "array"
1244
2360
  },
2361
+ "platform_site": {
2362
+ "anyOf": [
2363
+ {
2364
+ "items": {
2365
+ "$ref": "#/$defs/PlatformSite"
2366
+ },
2367
+ "type": "array"
2368
+ },
2369
+ {
2370
+ "type": "null"
2371
+ }
2372
+ ],
2373
+ "default": null,
2374
+ "description": "元数据平台站点组合;历史热门站点模式为 null",
2375
+ "title": "Platform Site"
2376
+ },
1245
2377
  "published": {
1246
- "description": "发布时间口径:T-0(当天)/ T-1(昨天)/ T-7(近7天)",
2378
+ "description": "发布时间口径(相对,支持按天或按分钟);触发时按 task_time 折算成绝对时间区间",
1247
2379
  "title": "Published",
1248
2380
  "type": "string"
1249
2381
  },
2382
+ "idate": {
2383
+ "anyOf": [
2384
+ {
2385
+ "type": "string"
2386
+ },
2387
+ {
2388
+ "type": "null"
2389
+ }
2390
+ ],
2391
+ "description": "入库时间口径(相对,按天或按分钟);null=该维度不过滤",
2392
+ "title": "Idate"
2393
+ },
2394
+ "udate": {
2395
+ "anyOf": [
2396
+ {
2397
+ "type": "string"
2398
+ },
2399
+ {
2400
+ "type": "null"
2401
+ }
2402
+ ],
2403
+ "description": "更新时间口径(相对,按天或按分钟);null=该维度不过滤",
2404
+ "title": "Udate"
2405
+ },
1250
2406
  "fields": {
1251
- "description": "拉取/导出字段(空=全量)",
2407
+ "description": "_id 自动输出,禁止在 fields 中填写;拉取/导出字段(空=全量)",
1252
2408
  "items": {
1253
2409
  "type": "string"
1254
2410
  },
1255
2411
  "title": "Fields",
1256
2412
  "type": "array"
1257
2413
  },
2414
+ "size": {
2415
+ "description": "每次执行最多导出的记录行数;普通批量保存时按系统配置校验,只取前 N 条时上限 10000",
2416
+ "title": "Size",
2417
+ "type": "integer"
2418
+ },
2419
+ "top": {
2420
+ "anyOf": [
2421
+ {
2422
+ "items": {
2423
+ "additionalProperties": true,
2424
+ "type": "object"
2425
+ },
2426
+ "type": "array"
2427
+ },
2428
+ {
2429
+ "type": "null"
2430
+ }
2431
+ ],
2432
+ "default": null,
2433
+ "description": "只取前 N 条的排序定义 [{field, order}];null = 给命中条件的全部数据。非 null 时每次执行只取按该排序排在前 size 条的数据",
2434
+ "title": "Top"
2435
+ },
1258
2436
  "frequency": {
1259
2437
  "description": "自然语言频率",
1260
2438
  "title": "Frequency",
@@ -1266,7 +2444,7 @@
1266
2444
  "type": "string"
1267
2445
  },
1268
2446
  "target_type": {
1269
- "description": "投递类型:octo(本期)/sftp/kafka",
2447
+ "description": "投递类型:octo、sftp、kafka(暂不支持)",
1270
2448
  "title": "Target Type",
1271
2449
  "type": "string"
1272
2450
  },
@@ -1298,7 +2476,10 @@
1298
2476
  "rule_ids",
1299
2477
  "source",
1300
2478
  "published",
2479
+ "idate",
2480
+ "udate",
1301
2481
  "fields",
2482
+ "size",
1302
2483
  "frequency",
1303
2484
  "cron",
1304
2485
  "target_type",
@@ -1311,6 +2492,13 @@
1311
2492
  "type": "object"
1312
2493
  },
1313
2494
  "flags": [
2495
+ {
2496
+ "flag": "--confirmed",
2497
+ "field": "confirmed",
2498
+ "type": "boolean",
2499
+ "required": false,
2500
+ "desc": "是否已确认继续并同意系统超限处理规则;修改取数配置超量时默认拒绝,true 允许保存但仍按上限截断;仅本次有效,TopN 不适用"
2501
+ },
1314
2502
  {
1315
2503
  "flag": "--job-id",
1316
2504
  "field": "job_id",
@@ -1323,61 +2511,1330 @@
1323
2511
  "field": "name",
1324
2512
  "type": "string",
1325
2513
  "required": false,
1326
- "desc": "新名称(全局唯一)"
2514
+ "desc": "新名称(同一凭证下唯一)"
1327
2515
  },
1328
2516
  {
1329
2517
  "flag": "--rule-ids",
1330
2518
  "field": "rule_ids",
1331
- "type": "list[str]",
2519
+ "type": "list[str](json)",
1332
2520
  "required": false,
1333
2521
  "desc": "整组全量覆盖"
1334
2522
  },
1335
2523
  {
1336
2524
  "flag": "--source",
1337
2525
  "field": "source",
1338
- "type": "list[str]",
2526
+ "type": "list[str](json)",
1339
2527
  "required": false,
1340
- "desc": "整组全量覆盖"
2528
+ "desc": "历史热门站点中文名数组,取 list_source;整体替换范围,与 platform_site 互斥"
2529
+ },
2530
+ {
2531
+ "flag": "--platform-site",
2532
+ "field": "platform_site",
2533
+ "type": "list[object](json)",
2534
+ "required": false,
2535
+ "desc": "元数据平台站点组合;整体替换范围,与 source 互斥;不传保持原范围"
1341
2536
  },
1342
2537
  {
1343
2538
  "flag": "--published",
1344
2539
  "field": "published",
1345
- "type": "enum(T-0、T-1、T-7)",
2540
+ "type": "string",
1346
2541
  "required": false,
1347
- "desc": "发布时间口径:T-0 / T-1 / T-7"
2542
+ "desc": "**发布时间**口径(必填字段,只能改不能清)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。"
2543
+ },
2544
+ {
2545
+ "flag": "--idate",
2546
+ "field": "idate",
2547
+ "type": "string",
2548
+ "required": false,
2549
+ "desc": "**入库时间**口径。不传=不改;传空串 \"\"=**清除**该维度(恢复成不过滤)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。"
2550
+ },
2551
+ {
2552
+ "flag": "--udate",
2553
+ "field": "udate",
2554
+ "type": "string",
2555
+ "required": false,
2556
+ "desc": "**更新时间**口径。不传=不改;传空串 \"\"=**清除**该维度(恢复成不过滤)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。"
1348
2557
  },
1349
2558
  {
1350
2559
  "flag": "--fields",
1351
2560
  "field": "fields",
1352
- "type": "list[str]",
2561
+ "type": "list[str](json)",
1353
2562
  "required": false,
1354
- "desc": "整组全量覆盖"
2563
+ "desc": "业务字段整组全量覆盖;_id 自动输出,禁止在 fields 中填写"
2564
+ },
2565
+ {
2566
+ "flag": "--size",
2567
+ "field": "size",
2568
+ "type": "integer",
2569
+ "required": false,
2570
+ "desc": "每次执行最多导出的记录行数;不传则不修改,普通批量默认上限 500000,TopN 默认上限 10000,实际以上游返回约束为准"
2571
+ },
2572
+ {
2573
+ "flag": "--frequency",
2574
+ "field": "frequency",
2575
+ "type": "string",
2576
+ "required": false,
2577
+ "desc": "传入则按新频率重算 cron(用法同创建;支持一天多次,如「每天9点和15点」);无法解析为 cron 会被拒绝"
2578
+ },
2579
+ {
2580
+ "flag": "--target",
2581
+ "field": "target",
2582
+ "type": "object(json)",
2583
+ "required": false,
2584
+ "desc": "整体替换投递目标"
2585
+ },
2586
+ {
2587
+ "flag": "--top",
2588
+ "field": "top",
2589
+ "type": "list[object](json)",
2590
+ "required": false,
2591
+ "desc": "只取前 N 条的排序规格:传入则整组替换,不传则不修改。切到该模式后 size 最大 10,000;传空数组 [] 表示改回「给全部命中数据」"
2592
+ },
2593
+ {
2594
+ "flag": "--active",
2595
+ "field": "active",
2596
+ "type": "enum(0、1)",
2597
+ "required": false,
2598
+ "desc": "启停:1 / 0"
2599
+ }
2600
+ ],
2601
+ "transport": {
2602
+ "method": "POST",
2603
+ "path": "/subscription/job_update",
2604
+ "send": "args"
2605
+ },
2606
+ "errors": [
2607
+ "auth_error",
2608
+ "validation",
2609
+ "api_error",
2610
+ "network",
2611
+ "internal"
2612
+ ]
2613
+ },
2614
+ {
2615
+ "action": "list-fields",
2616
+ "op": "list_fields",
2617
+ "name": "subscription/list_fields",
2618
+ "summary": "列出所选站点下可导出的字段:name_en(填 fields 用)、中文名、类型、是否枚举 / code。",
2619
+ "description": "列出所选站点下可导出的字段:name_en(填 fields 用)、中文名、类型、是否枚举 / code。\n\n``is_enum`` / ``is_code`` 为真的字段,导出文件里存的是枚举码 / 编码值;\n**若**调用方要把它们换成中文,再调 ``get_field_values`` 取字典自行替换(按需,非必经步骤)。",
2620
+ "input_schema": {
2621
+ "$defs": {
2622
+ "PlatformSite": {
2623
+ "additionalProperties": false,
2624
+ "properties": {
2625
+ "platform": {
2626
+ "description": "具体平台编码,禁止包含 *,取 list_platforms 的 name_en;全平台须逐一列出平台组合",
2627
+ "minLength": 1,
2628
+ "pattern": "^[^*]+$",
2629
+ "title": "Platform",
2630
+ "type": "string"
2631
+ },
2632
+ "sites": {
2633
+ "description": "站点编码数组,取 list_sites 的 value;[\"*\"] 表示该平台全部站点,不可混用",
2634
+ "items": {
2635
+ "minLength": 1,
2636
+ "type": "string"
2637
+ },
2638
+ "minItems": 1,
2639
+ "title": "Sites",
2640
+ "type": "array"
2641
+ }
2642
+ },
2643
+ "required": [
2644
+ "platform",
2645
+ "sites"
2646
+ ],
2647
+ "title": "PlatformSite",
2648
+ "type": "object"
2649
+ }
2650
+ },
2651
+ "additionalProperties": false,
2652
+ "properties": {
2653
+ "source": {
2654
+ "description": "历史热门站点中文名数组,取 list_source;与 platform_site 必须二选一",
2655
+ "items": {
2656
+ "minLength": 1,
2657
+ "type": "string"
2658
+ },
2659
+ "minItems": 1,
2660
+ "title": "Source",
2661
+ "type": "array"
2662
+ },
2663
+ "platform_site": {
2664
+ "anyOf": [
2665
+ {
2666
+ "items": {
2667
+ "$ref": "#/$defs/PlatformSite"
2668
+ },
2669
+ "minItems": 1,
2670
+ "type": "array"
2671
+ },
2672
+ {
2673
+ "type": "null"
2674
+ }
2675
+ ],
2676
+ "default": null,
2677
+ "description": "元数据平台站点组合;platform 取 list_platforms.name_en,sites 取 list_sites.value;与 source 二选一",
2678
+ "title": "Platform Site"
2679
+ },
2680
+ "keyword": {
2681
+ "anyOf": [
2682
+ {
2683
+ "maxLength": 64,
2684
+ "type": "string"
2685
+ },
2686
+ {
2687
+ "type": "null"
2688
+ }
2689
+ ],
2690
+ "default": null,
2691
+ "description": "按字段中文名 / name_en 模糊过滤(如「情感」「互动」);不传=该站点全部字段",
2692
+ "title": "Keyword"
2693
+ }
2694
+ },
2695
+ "title": "SubListFieldsInput",
2696
+ "type": "object"
2697
+ },
2698
+ "output_schema": {
2699
+ "$defs": {
2700
+ "SubField": {
2701
+ "additionalProperties": false,
2702
+ "description": "一个字段的订阅口径描述;selectable 区分可选业务字段与自动输出的系统字段。",
2703
+ "properties": {
2704
+ "name_en": {
2705
+ "description": "字段标识(ES 字段名),仅 selectable=true 时可填入 job_create / job_update 的 fields",
2706
+ "title": "Name En",
2707
+ "type": "string"
2708
+ },
2709
+ "field_origin": {
2710
+ "default": "source",
2711
+ "description": "字段来源:source 为业务字段,system 为系统字段",
2712
+ "title": "Field Origin",
2713
+ "type": "string"
2714
+ },
2715
+ "selectable": {
2716
+ "default": true,
2717
+ "description": "是否允许填入 fields;_id 自动输出,不可填写",
2718
+ "title": "Selectable",
2719
+ "type": "boolean"
2720
+ },
2721
+ "name": {
2722
+ "description": "字段中文名 —— 把用户说法对齐到 name_en 用",
2723
+ "title": "Name",
2724
+ "type": "string"
2725
+ },
2726
+ "data_type": {
2727
+ "description": "语义类型:keyword / text / long / double / date / boolean / object / nested",
2728
+ "title": "Data Type",
2729
+ "type": "string"
2730
+ },
2731
+ "description": {
2732
+ "default": "",
2733
+ "description": "字段描述;元数据未登记描述时为空串",
2734
+ "title": "Description",
2735
+ "type": "string"
2736
+ },
2737
+ "is_enum": {
2738
+ "description": "值来自内置枚举(如数据类型、情感):导出列存的是枚举码;如需换成中文,再按需调 get_field_values 取字典自行替换",
2739
+ "title": "Is Enum",
2740
+ "type": "boolean"
2741
+ },
2742
+ "is_code": {
2743
+ "description": "值是编码值(如品牌标签、品类标签):导出列存的是 code 而非中文;如需换成中文,再按需调 get_field_values 取字典自行替换",
2744
+ "title": "Is Code",
2745
+ "type": "boolean"
2746
+ }
2747
+ },
2748
+ "required": [
2749
+ "name_en",
2750
+ "name",
2751
+ "data_type",
2752
+ "is_enum",
2753
+ "is_code"
2754
+ ],
2755
+ "title": "SubField",
2756
+ "type": "object"
2757
+ }
2758
+ },
2759
+ "additionalProperties": false,
2760
+ "properties": {
2761
+ "items": {
2762
+ "description": "字段列表(所选站点的并集,按 name_en 排序)",
2763
+ "items": {
2764
+ "$ref": "#/$defs/SubField"
2765
+ },
2766
+ "title": "Items",
2767
+ "type": "array"
2768
+ },
2769
+ "total": {
2770
+ "description": "字段总数",
2771
+ "title": "Total",
2772
+ "type": "integer"
2773
+ }
2774
+ },
2775
+ "required": [
2776
+ "items",
2777
+ "total"
2778
+ ],
2779
+ "title": "SubFieldList",
2780
+ "type": "object"
2781
+ },
2782
+ "flags": [
2783
+ {
2784
+ "flag": "--source",
2785
+ "field": "source",
2786
+ "type": "list[str](json)",
2787
+ "required": false,
2788
+ "desc": "历史热门站点中文名数组,取 list_source;与 platform_site 必须二选一"
2789
+ },
2790
+ {
2791
+ "flag": "--platform-site",
2792
+ "field": "platform_site",
2793
+ "type": "list[object](json)",
2794
+ "required": false,
2795
+ "desc": "元数据平台站点组合;platform 取 list_platforms.name_en,sites 取 list_sites.value;与 source 二选一"
2796
+ },
2797
+ {
2798
+ "flag": "--keyword",
2799
+ "field": "keyword",
2800
+ "type": "string",
2801
+ "required": false,
2802
+ "desc": "按字段中文名 / name_en 模糊过滤(如「情感」「互动」);不传=该站点全部字段"
2803
+ }
2804
+ ],
2805
+ "transport": {
2806
+ "method": "POST",
2807
+ "path": "/subscription/list_fields",
2808
+ "send": "args"
2809
+ },
2810
+ "errors": [
2811
+ "auth_error",
2812
+ "validation",
2813
+ "api_error",
2814
+ "network",
2815
+ "internal"
2816
+ ]
2817
+ },
2818
+ {
2819
+ "action": "list-platforms",
2820
+ "op": "list_platforms",
2821
+ "name": "subscription/list_platforms",
2822
+ "summary": "列出舆情元数据平台,name_en 填入 platform_site[].platform。",
2823
+ "description": "列出舆情元数据平台,name_en 填入 platform_site[].platform。",
2824
+ "input_schema": {
2825
+ "type": "object",
2826
+ "properties": {},
2827
+ "additionalProperties": false
2828
+ },
2829
+ "output_schema": {
2830
+ "$defs": {
2831
+ "Platform": {
2832
+ "additionalProperties": false,
2833
+ "properties": {
2834
+ "name_en": {
2835
+ "description": "平台标识(= kw_platform 值)",
2836
+ "title": "Name En",
2837
+ "type": "string"
2838
+ },
2839
+ "name": {
2840
+ "description": "平台中文名",
2841
+ "title": "Name",
2842
+ "type": "string"
2843
+ },
2844
+ "description": {
2845
+ "default": "",
2846
+ "description": "平台描述",
2847
+ "title": "Description",
2848
+ "type": "string"
2849
+ },
2850
+ "index_prefix": {
2851
+ "default": "",
2852
+ "description": "索引前缀(索引名解析用)",
2853
+ "title": "Index Prefix",
2854
+ "type": "string"
2855
+ },
2856
+ "time_pattern": {
2857
+ "default": "",
2858
+ "description": "索引时间分片模式(如 yyyyMM)",
2859
+ "title": "Time Pattern",
2860
+ "type": "string"
2861
+ }
2862
+ },
2863
+ "required": [
2864
+ "name_en",
2865
+ "name"
2866
+ ],
2867
+ "title": "Platform",
2868
+ "type": "object"
2869
+ }
2870
+ },
2871
+ "additionalProperties": false,
2872
+ "properties": {
2873
+ "items": {
2874
+ "description": "元数据平台列表,name_en 填 platform_site.platform",
2875
+ "items": {
2876
+ "$ref": "#/$defs/Platform"
2877
+ },
2878
+ "title": "Items",
2879
+ "type": "array"
2880
+ },
2881
+ "total": {
2882
+ "description": "平台总数",
2883
+ "title": "Total",
2884
+ "type": "integer"
2885
+ }
2886
+ },
2887
+ "required": [
2888
+ "items",
2889
+ "total"
2890
+ ],
2891
+ "title": "SubPlatformList",
2892
+ "type": "object"
2893
+ },
2894
+ "flags": [],
2895
+ "transport": {
2896
+ "method": "POST",
2897
+ "path": "/subscription/list_platforms",
2898
+ "send": "args"
2899
+ },
2900
+ "errors": [
2901
+ "auth_error",
2902
+ "validation",
2903
+ "api_error",
2904
+ "network",
2905
+ "internal"
2906
+ ]
2907
+ },
2908
+ {
2909
+ "action": "list-sites",
2910
+ "op": "list_sites",
2911
+ "name": "subscription/list_sites",
2912
+ "summary": "搜索元数据站点,value 填 platform_site[].sites;原热门站点列表已改名 list_source。",
2913
+ "description": "搜索元数据站点,value 填 platform_site[].sites;原热门站点列表已改名 list_source。",
2914
+ "input_schema": {
2915
+ "additionalProperties": false,
2916
+ "properties": {
2917
+ "keyword": {
2918
+ "anyOf": [
2919
+ {
2920
+ "maxLength": 64,
2921
+ "type": "string"
2922
+ },
2923
+ {
2924
+ "type": "null"
2925
+ }
2926
+ ],
2927
+ "default": null,
2928
+ "description": "按站点中文名或编码搜索,建议传关键词收窄结果",
2929
+ "title": "Keyword"
2930
+ }
2931
+ },
2932
+ "title": "SubListSitesInput",
2933
+ "type": "object"
2934
+ },
2935
+ "output_schema": {
2936
+ "$defs": {
2937
+ "Site": {
2938
+ "additionalProperties": false,
2939
+ "properties": {
2940
+ "name": {
2941
+ "description": "站点中文名",
2942
+ "title": "Name",
2943
+ "type": "string"
2944
+ },
2945
+ "value": {
2946
+ "description": "ES 来源字段值(如 douyin.com);站点目录即字典,value_source=none",
2947
+ "title": "Value",
2948
+ "type": "string"
2949
+ },
2950
+ "is_key_site": {
2951
+ "default": false,
2952
+ "description": "是否重点站点",
2953
+ "title": "Is Key Site",
2954
+ "type": "boolean"
2955
+ }
2956
+ },
2957
+ "required": [
2958
+ "name",
2959
+ "value"
2960
+ ],
2961
+ "title": "Site",
2962
+ "type": "object"
2963
+ }
2964
+ },
2965
+ "additionalProperties": false,
2966
+ "properties": {
2967
+ "items": {
2968
+ "description": "元数据全局站点列表,value 填 platform_site.sites;不包含平台归属,保存时校验对应关系",
2969
+ "items": {
2970
+ "$ref": "#/$defs/Site"
2971
+ },
2972
+ "title": "Items",
2973
+ "type": "array"
2974
+ },
2975
+ "total": {
2976
+ "description": "命中站点总数",
2977
+ "title": "Total",
2978
+ "type": "integer"
2979
+ }
2980
+ },
2981
+ "required": [
2982
+ "items",
2983
+ "total"
2984
+ ],
2985
+ "title": "SubSiteList",
2986
+ "type": "object"
2987
+ },
2988
+ "flags": [
2989
+ {
2990
+ "flag": "--keyword",
2991
+ "field": "keyword",
2992
+ "type": "string",
2993
+ "required": false,
2994
+ "desc": "按站点中文名或编码搜索,建议传关键词收窄结果"
2995
+ }
2996
+ ],
2997
+ "transport": {
2998
+ "method": "POST",
2999
+ "path": "/subscription/list_sites",
3000
+ "send": "args"
3001
+ },
3002
+ "errors": [
3003
+ "auth_error",
3004
+ "validation",
3005
+ "api_error",
3006
+ "network",
3007
+ "internal"
3008
+ ]
3009
+ },
3010
+ {
3011
+ "action": "list-source",
3012
+ "op": "list_source",
3013
+ "name": "subscription/list_source",
3014
+ "summary": "列出可订阅站点(中文站点名)—— job_create / job_update 的 source 只能取这里的值。",
3015
+ "description": "列出可订阅站点(中文站点名)—— job_create / job_update 的 source 只能取这里的值。",
3016
+ "input_schema": {
3017
+ "type": "object",
3018
+ "properties": {},
3019
+ "additionalProperties": false
3020
+ },
3021
+ "output_schema": {
3022
+ "additionalProperties": false,
3023
+ "description": "可订阅站点名单(全量,无需翻页:站点由运维在表里配,量级有界)。",
3024
+ "properties": {
3025
+ "items": {
3026
+ "description": "中文站点名列表,即 job_create / job_update 的 source 该填的值(按配置顺序)",
3027
+ "items": {
3028
+ "type": "string"
3029
+ },
3030
+ "title": "Items",
3031
+ "type": "array"
3032
+ },
3033
+ "total": {
3034
+ "description": "站点总数",
3035
+ "title": "Total",
3036
+ "type": "integer"
3037
+ }
3038
+ },
3039
+ "required": [
3040
+ "items",
3041
+ "total"
3042
+ ],
3043
+ "title": "SubSourceList",
3044
+ "type": "object"
3045
+ },
3046
+ "flags": [],
3047
+ "transport": {
3048
+ "method": "POST",
3049
+ "path": "/subscription/list_source",
3050
+ "send": "args"
3051
+ },
3052
+ "errors": [
3053
+ "auth_error",
3054
+ "validation",
3055
+ "api_error",
3056
+ "network",
3057
+ "internal"
3058
+ ]
3059
+ },
3060
+ {
3061
+ "action": "precheck",
3062
+ "op": "precheck",
3063
+ "name": "subscription/precheck",
3064
+ "summary": "可选预览订阅创建/修改的数据量;正式保存会重新检查,TopN 保持原样。",
3065
+ "description": "可选预览订阅创建/修改的数据量;正式保存会重新检查,TopN 保持原样。",
3066
+ "input_schema": {
3067
+ "$defs": {
3068
+ "KafkaTarget": {
3069
+ "additionalProperties": false,
3070
+ "description": "kafka(规划):把记录流投送到 topic(无文件)。",
3071
+ "properties": {
3072
+ "type": {
3073
+ "const": "kafka",
3074
+ "description": "固定 kafka",
3075
+ "title": "Type",
3076
+ "type": "string"
3077
+ },
3078
+ "brokers": {
3079
+ "description": "broker 列表(逗号分隔)",
3080
+ "title": "Brokers",
3081
+ "type": "string"
3082
+ },
3083
+ "topic": {
3084
+ "description": "目标 topic",
3085
+ "title": "Topic",
3086
+ "type": "string"
3087
+ },
3088
+ "key_field": {
3089
+ "anyOf": [
3090
+ {
3091
+ "type": "string"
3092
+ },
3093
+ {
3094
+ "type": "null"
3095
+ }
3096
+ ],
3097
+ "default": null,
3098
+ "description": "作为消息 key 的字段名",
3099
+ "title": "Key Field"
3100
+ }
3101
+ },
3102
+ "required": [
3103
+ "type",
3104
+ "brokers",
3105
+ "topic"
3106
+ ],
3107
+ "title": "KafkaTarget",
3108
+ "type": "object"
3109
+ },
3110
+ "OctoTarget": {
3111
+ "additionalProperties": false,
3112
+ "description": "octo(本期,默认):导出文件上传 octo 存储,产出 CDN 下载 url(写入 file_info.url)。",
3113
+ "properties": {
3114
+ "type": {
3115
+ "const": "octo",
3116
+ "description": "固定 octo",
3117
+ "title": "Type",
3118
+ "type": "string"
3119
+ },
3120
+ "format": {
3121
+ "default": "json",
3122
+ "description": "文件格式:csv/excel/json(默认 json)",
3123
+ "enum": [
3124
+ "csv",
3125
+ "excel",
3126
+ "json"
3127
+ ],
3128
+ "title": "Format",
3129
+ "type": "string"
3130
+ }
3131
+ },
3132
+ "required": [
3133
+ "type"
3134
+ ],
3135
+ "title": "OctoTarget",
3136
+ "type": "object"
3137
+ },
3138
+ "PlatformSite": {
3139
+ "additionalProperties": false,
3140
+ "properties": {
3141
+ "platform": {
3142
+ "description": "具体平台编码,禁止包含 *,取 list_platforms 的 name_en;全平台须逐一列出平台组合",
3143
+ "minLength": 1,
3144
+ "pattern": "^[^*]+$",
3145
+ "title": "Platform",
3146
+ "type": "string"
3147
+ },
3148
+ "sites": {
3149
+ "description": "站点编码数组,取 list_sites 的 value;[\"*\"] 表示该平台全部站点,不可混用",
3150
+ "items": {
3151
+ "minLength": 1,
3152
+ "type": "string"
3153
+ },
3154
+ "minItems": 1,
3155
+ "title": "Sites",
3156
+ "type": "array"
3157
+ }
3158
+ },
3159
+ "required": [
3160
+ "platform",
3161
+ "sites"
3162
+ ],
3163
+ "title": "PlatformSite",
3164
+ "type": "object"
3165
+ },
3166
+ "SftpTarget": {
3167
+ "additionalProperties": false,
3168
+ "description": "sftp(本期):把导出文件上传到 SFTP 远端目录。\n目录与文件名都支持日期变量 ``yyyyMMdd`` / ``yyyyMM`` / ``yyyy``,同一个 task\n重跑多少次,远端路径与文件名都不变。",
3169
+ "properties": {
3170
+ "type": {
3171
+ "const": "sftp",
3172
+ "description": "固定 sftp",
3173
+ "title": "Type",
3174
+ "type": "string"
3175
+ },
3176
+ "host": {
3177
+ "description": "SFTP 主机,不能为空白",
3178
+ "minLength": 1,
3179
+ "title": "Host",
3180
+ "type": "string"
3181
+ },
3182
+ "port": {
3183
+ "default": 22,
3184
+ "description": "端口,1–65535,默认 22",
3185
+ "maximum": 65535,
3186
+ "minimum": 1,
3187
+ "title": "Port",
3188
+ "type": "integer"
3189
+ },
3190
+ "username": {
3191
+ "description": "登录用户名,不能为空白",
3192
+ "minLength": 1,
3193
+ "title": "Username",
3194
+ "type": "string"
3195
+ },
3196
+ "password": {
3197
+ "description": "登录密码,不能为空白,保留首尾空格",
3198
+ "minLength": 1,
3199
+ "title": "Password",
3200
+ "type": "string"
3201
+ },
3202
+ "remote_path": {
3203
+ "description": "远端目录/路径。可在**任意一层**用日期变量,但变量必须**独占一层**:`/data/sub/yyyyMM/yyyyMMdd` 合法,`/data/sub_yyyyMMdd` 非法。只认 yyyyMMdd / yyyyMM / yyyy 三种;不允许 '..'、空目录层。",
3204
+ "title": "Remote Path",
3205
+ "type": "string"
3206
+ },
3207
+ "filename_template": {
3208
+ "anyOf": [
3209
+ {
3210
+ "type": "string"
3211
+ },
3212
+ {
3213
+ "type": "null"
3214
+ }
3215
+ ],
3216
+ "default": null,
3217
+ "description": "自定义文件名模板(不含扩展名)。只允许字母、数字、'_'、'-' 与日期变量,且变量前后必须是 '_' 或首尾:`daily_yyyyMMdd_export`、`yyyyMM_summary` 合法,`dailyyyyyMMdd`、`report-yyyyMMdd-x` 非法。系统统一追加 `_<task_id>` 与扩展名。不传=沿用默认 `<job_id>_<task_id>.<ext>`。",
3218
+ "title": "Filename Template"
3219
+ },
3220
+ "format": {
3221
+ "default": "json",
3222
+ "description": "文件格式:csv/excel/json(默认 json)",
3223
+ "enum": [
3224
+ "csv",
3225
+ "excel",
3226
+ "json"
3227
+ ],
3228
+ "title": "Format",
3229
+ "type": "string"
3230
+ }
3231
+ },
3232
+ "required": [
3233
+ "type",
3234
+ "host",
3235
+ "username",
3236
+ "password",
3237
+ "remote_path"
3238
+ ],
3239
+ "title": "SftpTarget",
3240
+ "type": "object"
3241
+ },
3242
+ "SubJobCreateInput": {
3243
+ "additionalProperties": false,
3244
+ "properties": {
3245
+ "source": {
3246
+ "description": "历史热门站点中文名数组,取 list_source;与 platform_site 必须二选一",
3247
+ "items": {
3248
+ "minLength": 1,
3249
+ "type": "string"
3250
+ },
3251
+ "minItems": 1,
3252
+ "title": "Source",
3253
+ "type": "array"
3254
+ },
3255
+ "platform_site": {
3256
+ "anyOf": [
3257
+ {
3258
+ "items": {
3259
+ "$ref": "#/$defs/PlatformSite"
3260
+ },
3261
+ "minItems": 1,
3262
+ "type": "array"
3263
+ },
3264
+ {
3265
+ "type": "null"
3266
+ }
3267
+ ],
3268
+ "default": null,
3269
+ "description": "元数据平台站点组合;platform 取 list_platforms.name_en,sites 取 list_sites.value;与 source 二选一",
3270
+ "title": "Platform Site"
3271
+ },
3272
+ "confirmed": {
3273
+ "default": false,
3274
+ "description": "是否已确认继续并同意系统超限处理规则;超量时默认拒绝,true 允许保存但仍按上限截断;不跳过其他校验,不保存到 job,TopN 不适用",
3275
+ "title": "Confirmed",
3276
+ "type": "boolean"
3277
+ },
3278
+ "name": {
3279
+ "description": "job 名称,同一凭证(token)下唯一",
3280
+ "maxLength": 128,
3281
+ "minLength": 1,
3282
+ "title": "Name",
3283
+ "type": "string"
3284
+ },
3285
+ "rule_ids": {
3286
+ "description": "魔方规则ID数组,至少 1 个",
3287
+ "items": {
3288
+ "minLength": 1,
3289
+ "type": "string"
3290
+ },
3291
+ "minItems": 1,
3292
+ "title": "Rule Ids",
3293
+ "type": "array"
3294
+ },
3295
+ "published": {
3296
+ "description": "**发布时间**口径(必填,主口径 —— 它同时决定查哪个月的索引、怎么拆分片,所以不能缺省)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
3297
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)$",
3298
+ "title": "Published",
3299
+ "type": "string"
3300
+ },
3301
+ "idate": {
3302
+ "anyOf": [
3303
+ {
3304
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)$",
3305
+ "type": "string"
3306
+ },
3307
+ {
3308
+ "type": "null"
3309
+ }
3310
+ ],
3311
+ "default": null,
3312
+ "description": "**入库时间**口径(选填,不传=该维度不过滤)。在发布时间窗**之内**再 AND 一层:入库时间落在本区间的数据。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
3313
+ "title": "Idate"
3314
+ },
3315
+ "udate": {
3316
+ "anyOf": [
3317
+ {
3318
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)$",
3319
+ "type": "string"
3320
+ },
3321
+ {
3322
+ "type": "null"
3323
+ }
3324
+ ],
3325
+ "default": null,
3326
+ "description": "**更新时间**口径(选填,不传=该维度不过滤)。在发布时间窗**之内**再 AND 一层:更新时间落在本区间的数据。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
3327
+ "title": "Udate"
3328
+ },
3329
+ "frequency": {
3330
+ "description": "自然语言同步频率,系统转 cron(东八区)。可指定具体时间、并**支持一天多次**:如「每天9点」「每天9点和15点」(一天跑两次)「每周一9点」「每小时」「每30分钟」。无法解析为 cron 会被拒绝。",
3331
+ "maxLength": 64,
3332
+ "minLength": 1,
3333
+ "title": "Frequency",
3334
+ "type": "string"
3335
+ },
3336
+ "fields": {
3337
+ "description": "_id 自动输出,禁止在 fields 中填写;拉取/导出字段;不填拉全量",
3338
+ "items": {
3339
+ "minLength": 1,
3340
+ "type": "string"
3341
+ },
3342
+ "title": "Fields",
3343
+ "type": "array"
3344
+ },
3345
+ "size": {
3346
+ "anyOf": [
3347
+ {
3348
+ "maximum": 2147483647,
3349
+ "minimum": 1,
3350
+ "type": "integer"
3351
+ },
3352
+ {
3353
+ "type": "null"
3354
+ }
3355
+ ],
3356
+ "default": null,
3357
+ "description": "每次执行最多导出的记录行数。省略则按模式取默认:普通批量默认最多 500000 条,实际以服务端当前约束为准;传了 top(只取前 N 条)则默认 1,000、上限 10,000",
3358
+ "title": "Size"
3359
+ },
3360
+ "target": {
3361
+ "anyOf": [
3362
+ {
3363
+ "discriminator": {
3364
+ "mapping": {
3365
+ "kafka": "#/$defs/KafkaTarget",
3366
+ "octo": "#/$defs/OctoTarget",
3367
+ "sftp": "#/$defs/SftpTarget"
3368
+ },
3369
+ "propertyName": "type"
3370
+ },
3371
+ "oneOf": [
3372
+ {
3373
+ "$ref": "#/$defs/OctoTarget"
3374
+ },
3375
+ {
3376
+ "$ref": "#/$defs/SftpTarget"
3377
+ },
3378
+ {
3379
+ "$ref": "#/$defs/KafkaTarget"
3380
+ }
3381
+ ]
3382
+ },
3383
+ {
3384
+ "type": "null"
3385
+ }
3386
+ ],
3387
+ "default": null,
3388
+ "description": "投递目标;省略默认 octo(json)。本期支持 octo(上传存储→CDN url)与 sftp(账密上传远端,路径/文件名可用日期变量);kafka: 暂未实现。",
3389
+ "title": "Target"
3390
+ },
3391
+ "top": {
3392
+ "anyOf": [
3393
+ {
3394
+ "items": {
3395
+ "$ref": "#/$defs/TopSpec"
3396
+ },
3397
+ "type": "array"
3398
+ },
3399
+ {
3400
+ "type": "null"
3401
+ }
3402
+ ],
3403
+ "default": null,
3404
+ "description": "只取前 N 条(可选)。**不改变筛选条件** —— 省略时给命中条件的全部数据,传了则在同一批命中结果里按指定字段排序、只取前 size 条。排序跨发布窗内所有日期 / 站点 / 规则**全局生效**(不是每天各取 N)。多字段按顺序作排序优先级(前者相同时比后者)。字段必须是可排序类型(keyword / long / double / date)。该模式下 size 默认 1,000、最大 10,000;且多条规则改为 OR 合并并去重,导出的 kw_ruleId 恒为 topN、无法区分来源规则",
3405
+ "title": "Top"
3406
+ }
3407
+ },
3408
+ "required": [
3409
+ "name",
3410
+ "rule_ids",
3411
+ "published",
3412
+ "frequency"
3413
+ ],
3414
+ "title": "SubJobCreateInput",
3415
+ "type": "object"
3416
+ },
3417
+ "SubJobUpdateInput": {
3418
+ "additionalProperties": false,
3419
+ "properties": {
3420
+ "confirmed": {
3421
+ "default": false,
3422
+ "description": "是否已确认继续并同意系统超限处理规则;修改取数配置超量时默认拒绝,true 允许保存但仍按上限截断;仅本次有效,TopN 不适用",
3423
+ "title": "Confirmed",
3424
+ "type": "boolean"
3425
+ },
3426
+ "job_id": {
3427
+ "description": "目标 job",
3428
+ "title": "Job Id",
3429
+ "type": "integer"
3430
+ },
3431
+ "name": {
3432
+ "anyOf": [
3433
+ {
3434
+ "maxLength": 128,
3435
+ "minLength": 1,
3436
+ "type": "string"
3437
+ },
3438
+ {
3439
+ "type": "null"
3440
+ }
3441
+ ],
3442
+ "default": null,
3443
+ "description": "新名称(同一凭证下唯一)",
3444
+ "title": "Name"
3445
+ },
3446
+ "rule_ids": {
3447
+ "anyOf": [
3448
+ {
3449
+ "items": {
3450
+ "minLength": 1,
3451
+ "type": "string"
3452
+ },
3453
+ "minItems": 1,
3454
+ "type": "array"
3455
+ },
3456
+ {
3457
+ "type": "null"
3458
+ }
3459
+ ],
3460
+ "default": null,
3461
+ "description": "整组全量覆盖",
3462
+ "title": "Rule Ids"
3463
+ },
3464
+ "source": {
3465
+ "anyOf": [
3466
+ {
3467
+ "items": {
3468
+ "minLength": 1,
3469
+ "type": "string"
3470
+ },
3471
+ "minItems": 1,
3472
+ "type": "array"
3473
+ },
3474
+ {
3475
+ "type": "null"
3476
+ }
3477
+ ],
3478
+ "default": null,
3479
+ "description": "历史热门站点中文名数组,取 list_source;整体替换范围,与 platform_site 互斥",
3480
+ "title": "Source"
3481
+ },
3482
+ "platform_site": {
3483
+ "anyOf": [
3484
+ {
3485
+ "items": {
3486
+ "$ref": "#/$defs/PlatformSite"
3487
+ },
3488
+ "minItems": 1,
3489
+ "type": "array"
3490
+ },
3491
+ {
3492
+ "type": "null"
3493
+ }
3494
+ ],
3495
+ "default": null,
3496
+ "description": "元数据平台站点组合;整体替换范围,与 source 互斥;不传保持原范围",
3497
+ "title": "Platform Site"
3498
+ },
3499
+ "published": {
3500
+ "anyOf": [
3501
+ {
3502
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)$",
3503
+ "type": "string"
3504
+ },
3505
+ {
3506
+ "type": "null"
3507
+ }
3508
+ ],
3509
+ "default": null,
3510
+ "description": "**发布时间**口径(必填字段,只能改不能清)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
3511
+ "title": "Published"
3512
+ },
3513
+ "idate": {
3514
+ "anyOf": [
3515
+ {
3516
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
3517
+ "type": "string"
3518
+ },
3519
+ {
3520
+ "type": "null"
3521
+ }
3522
+ ],
3523
+ "default": null,
3524
+ "description": "**入库时间**口径。不传=不改;传空串 \"\"=**清除**该维度(恢复成不过滤)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
3525
+ "title": "Idate"
3526
+ },
3527
+ "udate": {
3528
+ "anyOf": [
3529
+ {
3530
+ "pattern": "^(?:T-\\d+~T-\\d+|T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d~T-\\d+@(?:[01]\\d|2[0-3]):[0-5]\\d)?$",
3531
+ "type": "string"
3532
+ },
3533
+ {
3534
+ "type": "null"
3535
+ }
3536
+ ],
3537
+ "default": null,
3538
+ "description": "**更新时间**口径。不传=不改;传空串 \"\"=**清除**该维度(恢复成不过滤)。支持两种相对时间口径:**按天 T-M~T-N** 与**按分钟 T-M@HH:mm~T-N@HH:mm**。M/N 是相对基准日的天数偏移,HH:mm 使用 24 小时制(00:00–23:59);基准时间取本次触发的 cron 槽位时间(东八区),手动触发取触发时间。**两个端点都必须写全且精度必须一致**:不接受 T-1 单值简写,也不允许T-1@07:00~T-0 这类按天、按分钟混用。所有口径均为左闭右闭区间 [start,end],即起止端点都包含。按天格式包含首尾自然日,查询时起始日补 00:00:00、结束日补 23:59:59。例如:T-0~T-0=今天;T-1~T-1=昨天;T-2~T-1=前天到昨天;T-7~T-1=近7天到昨天。按分钟格式包含首尾分钟,查询时起始分钟补 :00、结束分钟补 :59。例如:T-1@07:00~T-0@06:59=昨天07:00:00至今天06:59:59,完整覆盖昨天7点到今天6点时段;T-0@09:30~T-0@10:45=今天09:30:00至10:45:59。起点不得晚于终点;跨度最多 731 天(两年)、偏移最多 915 天(30个月),超限直接报错(不会静默回落)。",
3539
+ "title": "Udate"
3540
+ },
3541
+ "fields": {
3542
+ "anyOf": [
3543
+ {
3544
+ "items": {
3545
+ "minLength": 1,
3546
+ "type": "string"
3547
+ },
3548
+ "type": "array"
3549
+ },
3550
+ {
3551
+ "type": "null"
3552
+ }
3553
+ ],
3554
+ "default": null,
3555
+ "description": "业务字段整组全量覆盖;_id 自动输出,禁止在 fields 中填写",
3556
+ "title": "Fields"
3557
+ },
3558
+ "size": {
3559
+ "anyOf": [
3560
+ {
3561
+ "maximum": 2147483647,
3562
+ "minimum": 1,
3563
+ "type": "integer"
3564
+ },
3565
+ {
3566
+ "type": "null"
3567
+ }
3568
+ ],
3569
+ "default": null,
3570
+ "description": "每次执行最多导出的记录行数;不传则不修改,普通批量默认上限 500000,TopN 默认上限 10000,实际以上游返回约束为准",
3571
+ "title": "Size"
3572
+ },
3573
+ "frequency": {
3574
+ "anyOf": [
3575
+ {
3576
+ "maxLength": 64,
3577
+ "minLength": 1,
3578
+ "type": "string"
3579
+ },
3580
+ {
3581
+ "type": "null"
3582
+ }
3583
+ ],
3584
+ "default": null,
3585
+ "description": "传入则按新频率重算 cron(用法同创建;支持一天多次,如「每天9点和15点」);无法解析为 cron 会被拒绝",
3586
+ "title": "Frequency"
3587
+ },
3588
+ "target": {
3589
+ "anyOf": [
3590
+ {
3591
+ "discriminator": {
3592
+ "mapping": {
3593
+ "kafka": "#/$defs/KafkaTarget",
3594
+ "octo": "#/$defs/OctoTarget",
3595
+ "sftp": "#/$defs/SftpTarget"
3596
+ },
3597
+ "propertyName": "type"
3598
+ },
3599
+ "oneOf": [
3600
+ {
3601
+ "$ref": "#/$defs/OctoTarget"
3602
+ },
3603
+ {
3604
+ "$ref": "#/$defs/SftpTarget"
3605
+ },
3606
+ {
3607
+ "$ref": "#/$defs/KafkaTarget"
3608
+ }
3609
+ ]
3610
+ },
3611
+ {
3612
+ "type": "null"
3613
+ }
3614
+ ],
3615
+ "default": null,
3616
+ "description": "整体替换投递目标",
3617
+ "title": "Target"
3618
+ },
3619
+ "top": {
3620
+ "anyOf": [
3621
+ {
3622
+ "items": {
3623
+ "$ref": "#/$defs/TopSpec"
3624
+ },
3625
+ "type": "array"
3626
+ },
3627
+ {
3628
+ "type": "null"
3629
+ }
3630
+ ],
3631
+ "default": null,
3632
+ "description": "只取前 N 条的排序规格:传入则整组替换,不传则不修改。切到该模式后 size 最大 10,000;传空数组 [] 表示改回「给全部命中数据」",
3633
+ "title": "Top"
3634
+ },
3635
+ "active": {
3636
+ "anyOf": [
3637
+ {
3638
+ "enum": [
3639
+ 0,
3640
+ 1
3641
+ ],
3642
+ "type": "integer"
3643
+ },
3644
+ {
3645
+ "type": "null"
3646
+ }
3647
+ ],
3648
+ "default": null,
3649
+ "description": "启停:1 / 0",
3650
+ "title": "Active"
3651
+ }
3652
+ },
3653
+ "required": [
3654
+ "job_id"
3655
+ ],
3656
+ "title": "SubJobUpdateInput",
3657
+ "type": "object"
3658
+ },
3659
+ "TopSpec": {
3660
+ "additionalProperties": false,
3661
+ "description": "全局TopN排序规格(subscription专用)。",
3662
+ "properties": {
3663
+ "field": {
3664
+ "description": "排序字段(name_en);仅支持可排序类型(keyword/long/double/date)",
3665
+ "title": "Field",
3666
+ "type": "string"
3667
+ },
3668
+ "order": {
3669
+ "default": "desc",
3670
+ "description": "排序方向:desc降序(取最大的N个)/asc升序(取最小的N个)",
3671
+ "enum": [
3672
+ "asc",
3673
+ "desc"
3674
+ ],
3675
+ "title": "Order",
3676
+ "type": "string"
3677
+ }
3678
+ },
3679
+ "required": [
3680
+ "field"
3681
+ ],
3682
+ "title": "TopSpec",
3683
+ "type": "object"
3684
+ }
3685
+ },
3686
+ "additionalProperties": false,
3687
+ "properties": {
3688
+ "operation": {
3689
+ "description": "预览操作:create 创建或 update 修改",
3690
+ "enum": [
3691
+ "create",
3692
+ "update"
3693
+ ],
3694
+ "title": "Operation",
3695
+ "type": "string"
3696
+ },
3697
+ "create": {
3698
+ "anyOf": [
3699
+ {
3700
+ "$ref": "#/$defs/SubJobCreateInput"
3701
+ },
3702
+ {
3703
+ "type": "null"
3704
+ }
3705
+ ],
3706
+ "default": null,
3707
+ "description": "创建业务参数;仅 operation=create 时传入,confirmed 不影响预览"
3708
+ },
3709
+ "update": {
3710
+ "anyOf": [
3711
+ {
3712
+ "$ref": "#/$defs/SubJobUpdateInput"
3713
+ },
3714
+ {
3715
+ "type": "null"
3716
+ }
3717
+ ],
3718
+ "default": null,
3719
+ "description": "本人 job_id 和局部修改参数;仅 operation=update 时传入,confirmed 不影响预览"
3720
+ }
3721
+ },
3722
+ "required": [
3723
+ "operation"
3724
+ ],
3725
+ "title": "PrecheckInput",
3726
+ "type": "object"
3727
+ },
3728
+ "output_schema": {
3729
+ "additionalProperties": false,
3730
+ "properties": {
3731
+ "checked_at": {
3732
+ "description": "检查时间,东八区 ISO 时间",
3733
+ "title": "Checked At",
3734
+ "type": "string"
3735
+ },
3736
+ "windows": {
3737
+ "additionalProperties": {
3738
+ "anyOf": [
3739
+ {
3740
+ "type": "string"
3741
+ },
3742
+ {
3743
+ "type": "null"
3744
+ }
3745
+ ]
3746
+ },
3747
+ "description": "发布时间、入库时间、更新时间三个维度的绝对闭区间;空表示不过滤",
3748
+ "title": "Windows",
3749
+ "type": "object"
3750
+ },
3751
+ "matched_rows": {
3752
+ "description": "命中行数;count_relation=gte 时为下界,非精确总量",
3753
+ "title": "Matched Rows",
3754
+ "type": "integer"
3755
+ },
3756
+ "count_relation": {
3757
+ "description": "eq=精确计数;gte=至少命中该数量",
3758
+ "enum": [
3759
+ "eq",
3760
+ "gte"
3761
+ ],
3762
+ "title": "Count Relation",
3763
+ "type": "string"
3764
+ },
3765
+ "system_limit": {
3766
+ "anyOf": [
3767
+ {
3768
+ "type": "integer"
3769
+ },
3770
+ {
3771
+ "type": "null"
3772
+ }
3773
+ ],
3774
+ "description": "普通批量的系统导出上限;TopN 未执行预检时为空",
3775
+ "title": "System Limit"
3776
+ },
3777
+ "effective_limit": {
3778
+ "description": "本次生效的单次最大导出行数",
3779
+ "title": "Effective Limit",
3780
+ "type": "integer"
3781
+ },
3782
+ "would_truncate": {
3783
+ "description": "当前统计是否超出有效导出数量;TopN 不新增预检",
3784
+ "title": "Would Truncate",
3785
+ "type": "boolean"
3786
+ },
3787
+ "checked": {
3788
+ "default": true,
3789
+ "description": "是否执行数据量统计;TopN 为 false",
3790
+ "title": "Checked",
3791
+ "type": "boolean"
3792
+ },
3793
+ "message": {
3794
+ "description": "数量提示及调整参数或确认继续的说明",
3795
+ "title": "Message",
3796
+ "type": "string"
3797
+ }
1355
3798
  },
3799
+ "required": [
3800
+ "checked_at",
3801
+ "windows",
3802
+ "matched_rows",
3803
+ "count_relation",
3804
+ "system_limit",
3805
+ "effective_limit",
3806
+ "would_truncate",
3807
+ "message"
3808
+ ],
3809
+ "title": "PrecheckResult",
3810
+ "type": "object"
3811
+ },
3812
+ "flags": [
1356
3813
  {
1357
- "flag": "--frequency",
1358
- "field": "frequency",
1359
- "type": "string",
1360
- "required": false,
1361
- "desc": "传入则按新频率重算 cron(用法同创建;支持一天多次,如「每天9点和15点」);无法解析为 cron 会被拒绝"
3814
+ "flag": "--operation",
3815
+ "field": "operation",
3816
+ "type": "enum(create、update)",
3817
+ "required": true,
3818
+ "desc": "预览操作:create 创建或 update 修改"
1362
3819
  },
1363
3820
  {
1364
- "flag": "--target",
1365
- "field": "target",
3821
+ "flag": "--create",
3822
+ "field": "create",
1366
3823
  "type": "object(json)",
1367
3824
  "required": false,
1368
- "desc": "整体替换投递目标"
3825
+ "desc": "创建业务参数;仅 operation=create 时传入,confirmed 不影响预览"
1369
3826
  },
1370
3827
  {
1371
- "flag": "--active",
1372
- "field": "active",
1373
- "type": "enum(0、1)",
3828
+ "flag": "--update",
3829
+ "field": "update",
3830
+ "type": "object(json)",
1374
3831
  "required": false,
1375
- "desc": "启停:1 / 0"
3832
+ "desc": "本人 job_id 和局部修改参数;仅 operation=update 时传入,confirmed 不影响预览"
1376
3833
  }
1377
3834
  ],
1378
3835
  "transport": {
1379
3836
  "method": "POST",
1380
- "path": "/subscription/job_update",
3837
+ "path": "/subscription/precheck",
1381
3838
  "send": "args"
1382
3839
  },
1383
3840
  "errors": [
@@ -1509,6 +3966,28 @@
1509
3966
  "title": "Job Id",
1510
3967
  "type": "integer"
1511
3968
  },
3969
+ "size": {
3970
+ "description": "本次任务记录的导出数量;实际执行受系统当前总量上限约束,TopN 默认上限 10000 条",
3971
+ "title": "Size",
3972
+ "type": "integer"
3973
+ },
3974
+ "top": {
3975
+ "anyOf": [
3976
+ {
3977
+ "items": {
3978
+ "additionalProperties": true,
3979
+ "type": "object"
3980
+ },
3981
+ "type": "array"
3982
+ },
3983
+ {
3984
+ "type": "null"
3985
+ }
3986
+ ],
3987
+ "default": null,
3988
+ "description": "本次生效的排序快照 [{field, order}];null = 取了命中条件的全部数据。非 null 时本次只取按该排序排在前 size 条的数据",
3989
+ "title": "Top"
3990
+ },
1512
3991
  "status": {
1513
3992
  "description": "pending/running/success/failed/terminated",
1514
3993
  "title": "Status",
@@ -1538,7 +4017,7 @@
1538
4017
  }
1539
4018
  ],
1540
4019
  "default": null,
1541
- "description": "失败原因(status=failed 时给出;成功/进行中为空)",
4020
+ "description": "对外可操作的失败提示;系统异常仅给通用提示,内部细节不返回",
1542
4021
  "title": "Error Msg"
1543
4022
  },
1544
4023
  "created_at": {
@@ -1555,6 +4034,7 @@
1555
4034
  "required": [
1556
4035
  "task_id",
1557
4036
  "job_id",
4037
+ "size",
1558
4038
  "status",
1559
4039
  "created_at",
1560
4040
  "updated_at"
@@ -1660,13 +4140,19 @@
1660
4140
  ],
1661
4141
  "skill": {
1662
4142
  "slug": "social-neuron-subscription",
1663
- "description": "使用场景:定时导出/订阅推送/定期拉数/大批量出文件——需异步产出文件并下载时用能力:按魔方规则、定时 cron 或手动触发,把大库数据异步导出为文件,上传 octo/sftp,产出下载 url 供调用方轮询拉取;可创建/修改/列出/删除/触发订阅 job、翻页查询 task。概念:job=订阅定义(数据范围+频率+投递方式,系统按频率生成 cron);task=job 的一次执行,产物与下载地址落在 file_info。边界:①每 token 生效 job 默认≤10;②单次拉数≤10 万行,超出截断;③投递仅 octo/sftp(kafka 规划中,暂不支持),无主动通知、须轮询 task 取结果。④如果拉取不到数据则不会产生文件上传,也就没有文件url信息",
4143
+ "description": "使用场景:定时导出/订阅推送/定期拉数/大批量出文件——需异步产出文件并下载时用能力:按魔方规则、定时 cron 或手动触发,把大库数据异步导出为文件,上传 octo/sftp,产出下载 url 供调用方轮询拉取;可创建/修改/列出/删除/触发订阅 job、翻页查询 task;普通批量创建/取数配置修改有数据量预检,可选 precheck 只读预览;超量先提示调整参数或征求用户确认,明确同意系统超限规则后才以 confirmed=true 重提,导出仍按上限截断;订阅范围二选一:热门站点用 source(list_source 返回的中文名,按已有配置确定范围);指定平台站点用 platform_site(platform 取 list_platforms.name_en,sites 取 list_sites.value),适用于指定平台下站点、不同平台各自站点或整个平台,sites=[\"*\"] 表示该平台全部站点;范围选择与是否 TopN 独立,两种范围均支持普通批量或 TopN。发现接口:list_source / list_platforms / list_sites 对齐范围,list_fields 对齐字段;原 list_sites 的热门站点列表已改名 list_source,新 list_sites 返回元数据站点对象;get_field_values 给出枚举值 / 编码值的中文字典,仅在用户明确要求把导出的码值换成中文时按需取用(换值由调用方拿到数据后自行完成,系统不自动回显)。概念:job=订阅定义(数据范围+频率+投递方式,系统按频率生成 cron);task=job 的一次执行,产物与下载地址落在 file_info。边界:①每 token 生效 job 默认≤10;②两种取数模式二选一:**默认**给命中条件的全部数据、size 默认/最大 50 万、多规则各自拉(同时命中多条规则的数据会重复出现);传 **top** 则不改筛选条件、只在同一批命中里按指定字段跨全部日期/站点/规则排序后取前 N 条、size 默认 1000 最大 10000、多规则 OR 合并(同时命中多条的只出一份),排序字段只能是 keyword/long/double/date 类型;这与平台自身的热搜/热门榜单无关;③导出数据的 kw_ruleId 字段**恒为数组**(列出本行命中的 rule_id;此前是字符串,按老格式解析的下游需改);④投递仅 octo/sftp(kafka 规划中,暂不支持),无主动通知、须轮询 task 取结果。⑤如果拉取不到数据则不会产生文件上传,也就没有文件url信息",
1664
4144
  "actions": [
4145
+ "get-field-values",
1665
4146
  "job-create",
1666
4147
  "job-delete",
1667
4148
  "job-list",
1668
4149
  "job-trigger",
1669
4150
  "job-update",
4151
+ "list-fields",
4152
+ "list-platforms",
4153
+ "list-sites",
4154
+ "list-source",
4155
+ "precheck",
1670
4156
  "task-list"
1671
4157
  ]
1672
4158
  }