oc-browser-relay 1.0.23 → 1.0.25

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.
@@ -23043,25 +23043,24 @@ function formatDateLocal(date) {
23043
23043
  const day = String(date.getDate()).padStart(2, "0");
23044
23044
  return `${year}-${month}-${day}`;
23045
23045
  }
23046
- function buildPreviousAvailableDailyDateRange(now = /* @__PURE__ */ new Date()) {
23047
- const target = new Date(now);
23048
- const daysBack = now.getHours() < 6 ? 2 : 1;
23049
- target.setDate(target.getDate() - daysBack);
23050
- const date = formatDateLocal(target);
23051
- return `${date}|${date}`;
23046
+ function shiftDate(d, days) {
23047
+ const r = new Date(d);
23048
+ r.setDate(r.getDate() + days);
23049
+ return r;
23052
23050
  }
23053
- function buildEffectiveDailyPeriod(now = /* @__PURE__ */ new Date()) {
23054
- const daysBack = now.getHours() < 6 ? 2 : 1;
23055
- const target = new Date(now);
23056
- target.setDate(target.getDate() - daysBack);
23057
- const date = formatDateLocal(target);
23058
- return {
23059
- effectiveMetricPeriodLabel: daysBack === 2 ? "\u524D\u5929" : "\u6628\u5929",
23060
- effectiveDateRange: `${date}|${date}`
23061
- };
23051
+ function diffDays(a, b) {
23052
+ return Math.round((b.getTime() - a.getTime()) / 864e5);
23062
23053
  }
23063
- function normalizeMetricPeriodLabel(value) {
23064
- return typeof value === "string" ? value.replace(/\s+/g, "") : "";
23054
+ function buildCompareRange(currentStart, currentEnd) {
23055
+ const days = diffDays(currentStart, currentEnd) + 1;
23056
+ const compareEnd = shiftDate(currentStart, -1);
23057
+ const compareStart = shiftDate(compareEnd, -(days - 1));
23058
+ return `${formatDateLocal(currentStart)}|${formatDateLocal(currentEnd)},${formatDateLocal(compareStart)}|${formatDateLocal(compareEnd)}`;
23059
+ }
23060
+ function buildDayRange(now = /* @__PURE__ */ new Date()) {
23061
+ const daysBack = now.getHours() < 6 ? 2 : 1;
23062
+ const d = shiftDate(now, -daysBack);
23063
+ return { dateRange: buildCompareRange(d, d), label: daysBack === 2 ? "\u524D\u5929" : "\u6628\u5929" };
23065
23064
  }
23066
23065
  function truncateByCharacters(value, maxLength) {
23067
23066
  return Array.from(value).slice(0, maxLength).join("");
@@ -23191,46 +23190,21 @@ var TemplateExecutor = class _TemplateExecutor {
23191
23190
  }
23192
23191
  }
23193
23192
  applySycmLiveMetricDerivedDefaults(template, rawInput, hydrated) {
23194
- const isSycmLiveMetricsTemplate = template.siteId === "sycm_taobao" && template.taskType === "browser_action" && (template.optionalFields ?? []).some((field) => field.name === "metricPeriodLabel");
23193
+ const isSycmLiveMetricsTemplate = template.siteId === "sycm_taobao" && template.taskType === "browser_action" && (template.optionalFields ?? []).some((field) => field.name === "requestDateType");
23195
23194
  if (!isSycmLiveMetricsTemplate) {
23196
23195
  return;
23197
23196
  }
23198
- const normalizedLabel = normalizeMetricPeriodLabel(hydrated.metricPeriodLabel);
23199
- const hasExplicitDateType = rawInput.requestDateType !== void 0;
23200
- const hasExplicitDateRange = rawInput.requestDateRange !== void 0;
23201
- const hasExplicitInvokeDirectly = rawInput.invokeDirectly !== void 0;
23202
- const isYesterdayLabel = normalizedLabel === "\u6628\u5929";
23203
- if (!hasExplicitDateType) {
23204
- switch (normalizedLabel) {
23205
- case "\u6628\u5929":
23206
- case "\u65E5":
23207
- hydrated.requestDateType = "day";
23208
- break;
23209
- case "\u5468":
23210
- hydrated.requestDateType = "week";
23211
- break;
23212
- case "\u6708":
23213
- hydrated.requestDateType = "month";
23214
- break;
23215
- case "\u5B9E\u65F6":
23216
- hydrated.requestDateType = "today";
23217
- break;
23218
- default:
23219
- break;
23220
- }
23221
- }
23222
- if (!hasExplicitDateRange) {
23223
- hydrated.requestDateRange = isYesterdayLabel ? buildPreviousAvailableDailyDateRange() : "";
23197
+ if (rawInput.requestDateType !== void 0) {
23198
+ return;
23224
23199
  }
23225
- if (isYesterdayLabel) {
23226
- const effectiveDailyPeriod = buildEffectiveDailyPeriod();
23227
- hydrated.effectiveMetricPeriodLabel = effectiveDailyPeriod.effectiveMetricPeriodLabel;
23228
- hydrated.effectiveDateRange = effectiveDailyPeriod.effectiveDateRange;
23229
- if ((/* @__PURE__ */ new Date()).getHours() < 6) {
23230
- hydrated.invokeDirectly = true;
23231
- } else if (!hasExplicitInvokeDirectly && hydrated.invokeDirectly === void 0) {
23232
- hydrated.invokeDirectly = false;
23233
- }
23200
+ if (!hydrated.requestDateRange) {
23201
+ const r = buildDayRange();
23202
+ hydrated.requestDateType = "compareRange";
23203
+ hydrated.requestDateRange = r.dateRange;
23204
+ hydrated.effectiveMetricPeriodLabel = r.label;
23205
+ hydrated.effectiveDateRange = r.dateRange.split(",")[0];
23206
+ } else if (!hydrated.requestDateType) {
23207
+ hydrated.requestDateType = "compareRange";
23234
23208
  }
23235
23209
  }
23236
23210
  mergeXiaohongshuTopicsIntoContent(template, data) {
@@ -221,6 +221,71 @@
221
221
  "responsePath": "data.taskId",
222
222
  "metaPath": "data"
223
223
  },
224
+ "create_adgroup_download_task": {
225
+ "method": "POST",
226
+ "url": "https://one.alimama.com/report/createDownLoadTask.json",
227
+ "query": {
228
+ "csrfId": "{{payload.csrfId}}",
229
+ "bizCode": "universalBP"
230
+ },
231
+ "headers": {
232
+ "Content-Type": "application/json"
233
+ },
234
+ "body": {
235
+ "excelName": "{{payload.excelName}}",
236
+ "pageSize": 20,
237
+ "offset": 0,
238
+ "havingList": [],
239
+ "endTime": "{{payload.endTime}}",
240
+ "from": "pcBaseReport",
241
+ "unifyType": "zhai",
242
+ "effectEqual": 15,
243
+ "startTime": "{{payload.startTime}}",
244
+ "splitType": "{{payload.splitType}}",
245
+ "bizCodeIn": [
246
+ "onebpSearch"
247
+ ],
248
+ "queryFieldIn": [
249
+ "adPv",
250
+ "click",
251
+ "charge",
252
+ "ctr",
253
+ "ecpc",
254
+ "alipayInshopAmt",
255
+ "alipayInshopNum",
256
+ "cvr",
257
+ "cartInshopNum",
258
+ "itemColInshopNum",
259
+ "shopColDirNum",
260
+ "colNum",
261
+ "itemColInshopCost"
262
+ ],
263
+ "vsType": "{{payload.vsType}}",
264
+ "vsTime": "{{payload.vsTime}}",
265
+ "searchValue": "{{payload.searchValue}}",
266
+ "searchKey": "strategyCampaignIdOrName",
267
+ "queryDomains": [
268
+ "adgroup",
269
+ "date",
270
+ "campaign"
271
+ ],
272
+ "adzonePkgIdIn": [
273
+ "114786650498",
274
+ "114790550288"
275
+ ],
276
+ "fieldType": "all",
277
+ "rptType": "adgroup",
278
+ "parentAdcName": "report_frame_adgroup",
279
+ "byPage": false,
280
+ "fromRealTime": false,
281
+ "source": "async_dowdload",
282
+ "csrfId": "{{payload.csrfId}}",
283
+ "bizCode": "universalBP",
284
+ "loginPointId": "{{payload.loginPointId}}"
285
+ },
286
+ "responsePath": "data.taskId",
287
+ "metaPath": "data"
288
+ },
224
289
  "get_download_url": {
225
290
  "method": "GET",
226
291
  "url": "https://bpcommon.alimama.com/commonapi/report/async/getDownloadUrl.json",
@@ -156,6 +156,7 @@
156
156
  "apiSources": {
157
157
  "live_metrics_overview": {
158
158
  "method": "GET",
159
+ "removeHeaders": ["Bx-ua"],
159
160
  "urlVariants": [
160
161
  {
161
162
  "whenPath": "payload.dateType",
@@ -182,6 +183,7 @@
182
183
  },
183
184
  "live_metrics_trend": {
184
185
  "method": "GET",
186
+ "removeHeaders": ["Bx-ua"],
185
187
  "urlVariants": [
186
188
  {
187
189
  "whenPath": "payload.dateType",
@@ -205,6 +207,41 @@
205
207
  "responsePath": "content.data.data",
206
208
  "metaPath": "content.data"
207
209
  },
210
+ "live_metrics_custom_overview": {
211
+ "method": "GET",
212
+ "removeHeaders": ["Bx-ua"],
213
+ "url": "https://sycm.taobao.com/portal/long/period/nodistinct/coreIndex/getShopMainIndexes/v3.json",
214
+ "query": {
215
+ "needCycleCrc": "true",
216
+ "dateType": "compareRange",
217
+ "dateRange": "{{payload.dateRange}}",
218
+ "device": "{{payload.device}}",
219
+ "_": "{{runtime.timestamp}}",
220
+ "token": "{{session.token}}"
221
+ },
222
+ "headers": {
223
+ "sycm-referer": "/portal/home.htm"
224
+ },
225
+ "responsePath": "content.data.data",
226
+ "metaPath": "content.data"
227
+ },
228
+ "live_metrics_custom_trend": {
229
+ "method": "GET",
230
+ "removeHeaders": ["Bx-ua"],
231
+ "url": "https://sycm.taobao.com/portal/long/period/nodistinct/coreIndex/new/trend/v3.json",
232
+ "query": {
233
+ "dateType": "compareRange",
234
+ "dateRange": "{{payload.dateRange}}",
235
+ "device": "{{payload.device}}",
236
+ "_": "{{runtime.timestamp}}",
237
+ "token": "{{session.token}}"
238
+ },
239
+ "headers": {
240
+ "sycm-referer": "/portal/home.htm"
241
+ },
242
+ "responsePath": "content.data.data",
243
+ "metaPath": "content.data"
244
+ },
208
245
  "growth_factor_overview": {
209
246
  "method": "GET",
210
247
  "url": "https://sycm.taobao.com/portal/board/grow/factor/overview.json",
@@ -0,0 +1,166 @@
1
+ {
2
+ "siteId": "alimama_report",
3
+ "taskType": "download_adgroup_report",
4
+ "platform": "taobao",
5
+ "name": "下载阿里妈妈单元报表",
6
+ "description": "打开阿里妈妈账户报表页,捕获鉴权信息,创建单元报表异步下载任务,轮询下载链接并将文件回传 relay 存储。",
7
+ "requiredFields": [
8
+ {
9
+ "name": "startTime",
10
+ "type": "string",
11
+ "description": "报表开始日期,格式 YYYY-MM-DD"
12
+ },
13
+ {
14
+ "name": "endTime",
15
+ "type": "string",
16
+ "description": "报表结束日期,格式 YYYY-MM-DD"
17
+ }
18
+ ],
19
+ "optionalFields": [
20
+ {
21
+ "name": "splitType",
22
+ "type": "string",
23
+ "description": "报表时间粒度,支持 sum/day/week/month/calendarmonth",
24
+ "default": "sum"
25
+ },
26
+ {
27
+ "name": "returnHostPatterns",
28
+ "type": "array",
29
+ "description": "任务结束后若存在匹配这些 host 或 URL 片段的标签页,则切回该标签页"
30
+ }
31
+ ],
32
+ "nodes": [
33
+ {
34
+ "nodeId": "s1",
35
+ "name": "open_alimama_report",
36
+ "goal": "打开阿里妈妈账户报表页并预抓鉴权接口",
37
+ "tool": "open_tab",
38
+ "args": {
39
+ "url": "https://one.alimama.com/index.html#!/report/account?rptType=account",
40
+ "captureNetwork": {
41
+ "capturePlanId": "auth_info"
42
+ }
43
+ }
44
+ },
45
+ {
46
+ "nodeId": "s2",
47
+ "name": "validate_alimama_report",
48
+ "goal": "校验当前页面已进入账户报表页",
49
+ "tool": "validate_page",
50
+ "args": {}
51
+ },
52
+ {
53
+ "nodeId": "s3",
54
+ "name": "collect_auth_info",
55
+ "goal": "从 checkAccess 响应中提取 csrfId 和 loginPointId",
56
+ "tool": "collect_structured_data",
57
+ "args": {
58
+ "extractor": "download_auth_info",
59
+ "sourceNodeId": "s1"
60
+ },
61
+ "storeAs": "authInfo"
62
+ },
63
+ {
64
+ "nodeId": "s4",
65
+ "name": "show_download_activity",
66
+ "goal": "在页面顶部展示独立提示,标记当前正在准备单元报表下载",
67
+ "tool": "present_page_activity",
68
+ "args": {
69
+ "mode": "start",
70
+ "message": "正在提交报表下载任务",
71
+ "style": "info",
72
+ "profile": "none"
73
+ }
74
+ },
75
+ {
76
+ "nodeId": "s5",
77
+ "name": "create_adgroup_download_task",
78
+ "goal": "创建单元报表异步下载任务",
79
+ "tool": "invoke_page_request",
80
+ "args": {
81
+ "sourceId": "create_adgroup_download_task",
82
+ "payload": {
83
+ "startTime": "{{data.startTime}}",
84
+ "endTime": "{{data.endTime}}",
85
+ "vsTime": "{{data.endTime}}",
86
+ "vsType": "week",
87
+ "searchValue": "",
88
+ "splitType": "{{data.splitType}}",
89
+ "excelName": "单元报表_{{data.startTime}}_{{data.endTime}}"
90
+ }
91
+ },
92
+ "fromContext": {
93
+ "payload.csrfId": "outputs.authInfo.data.csrfId",
94
+ "payload.loginPointId": "outputs.authInfo.data.loginPointId"
95
+ },
96
+ "storeAs": "downloadTask"
97
+ },
98
+ {
99
+ "nodeId": "s6",
100
+ "name": "update_download_activity",
101
+ "goal": "更新页面提示为等待报表生成完成",
102
+ "tool": "present_page_activity",
103
+ "args": {
104
+ "mode": "start",
105
+ "message": "正在等待报表生成完成",
106
+ "style": "info",
107
+ "profile": "none"
108
+ }
109
+ },
110
+ {
111
+ "nodeId": "s7",
112
+ "name": "poll_download_url",
113
+ "goal": "等待下载任务生成链接并轮询拿到下载地址",
114
+ "tool": "invoke_page_request",
115
+ "args": {
116
+ "sourceId": "get_download_url",
117
+ "payload": {},
118
+ "polling": {
119
+ "initialDelayMs": 30000,
120
+ "intervalMs": 5000,
121
+ "timeoutMs": 120000,
122
+ "maxAttempts": 25
123
+ }
124
+ },
125
+ "fromContext": {
126
+ "payload.taskId": "outputs.downloadTask.response.data",
127
+ "payload.csrfId": "outputs.authInfo.data.csrfId",
128
+ "payload.loginPointId": "outputs.authInfo.data.loginPointId"
129
+ },
130
+ "storeAs": "downloadLink"
131
+ },
132
+ {
133
+ "nodeId": "s8",
134
+ "name": "download_report_file",
135
+ "goal": "拉取下载链接并把文件内容回传给 relay 存储",
136
+ "tool": "download_page_file",
137
+ "args": {
138
+ "filename": "单元报表_{{data.startTime}}_{{data.endTime}}.zip"
139
+ },
140
+ "fromContext": {
141
+ "url": "outputs.downloadLink.response.data"
142
+ },
143
+ "storeAs": "downloadResult"
144
+ },
145
+ {
146
+ "nodeId": "s9",
147
+ "name": "hide_download_activity",
148
+ "goal": "在下载链路结束后关闭页面提示",
149
+ "tool": "present_page_activity",
150
+ "args": {
151
+ "mode": "stop"
152
+ }
153
+ },
154
+ {
155
+ "nodeId": "s10",
156
+ "name": "switch_to_existing_host_tab",
157
+ "goal": "任务结束后若存在匹配的既有标签页则切回去",
158
+ "when": "exists(payload.returnHostPatterns)",
159
+ "tool": "switch_tab",
160
+ "args": {
161
+ "urlIncludesAny": "{{data.returnHostPatterns}}",
162
+ "optional": true
163
+ }
164
+ }
165
+ ]
166
+ }
@@ -3,6 +3,7 @@
3
3
  "alimama-campaign-report-download.json",
4
4
  "alimama-crowd-report-download.json",
5
5
  "alimama-keyword-report-download.json",
6
+ "alimama-adgroup-report-download.json",
6
7
  "sycm-taobao-home-live-metrics.json",
7
8
  "sycm-taobao-api-group.json",
8
9
  "pinduoduo-mms-home-overview.json",
@@ -3,7 +3,7 @@
3
3
  "taskType": "browser_action",
4
4
  "platform": "taobao",
5
5
  "name": "采集生意参谋首页店铺数据",
6
- "description": "打开生意参谋首页,点击“昨天 / 实时 / 日 / 周 / 月”之一,同时采集首页概览与趋势接口。",
6
+ "description": "打开生意参谋首页,直接构造请求调用首页概览与趋势接口。",
7
7
  "requiredFields": [],
8
8
  "optionalFields": [
9
9
  {
@@ -12,34 +12,21 @@
12
12
  "description": "生意参谋首页地址,默认首页",
13
13
  "default": "https://sycm.taobao.com/portal/home.htm"
14
14
  },
15
- {
16
- "name": "metricPeriodLabel",
17
- "type": "string",
18
- "description": "首页时间粒度按钮文本,支持:昨天、实时、日、周、月",
19
- "default": "昨天"
20
- },
21
- {
22
- "name": "invokeDirectly",
23
- "type": "boolean",
24
- "description": "是否跳过页面点击,直接在页面会话内调用接口;06:00 前请求“昨天”时会强制走直调以回退到前天",
25
- "default": false
26
- },
27
15
  {
28
16
  "name": "requestDateType",
29
17
  "type": "string",
30
- "description": "直调接口时使用的 dateType,例如 today/day/week/month;未传时会按 metricPeriodLabel 自动推导",
31
- "default": "today"
18
+ "description": "时间类型:today(实时当日数据);不传则默认取昨天数据"
32
19
  },
33
20
  {
34
21
  "name": "requestDateRange",
35
22
  "type": "string",
36
- "description": "直调接口时使用的 dateRange,格式 YYYY-MM-DD|YYYY-MM-DD;未传时“昨天”会自动补成可用的最近日范围,6 点前回退到前天,实时可留空",
23
+ "description": "自定义日期范围,格式 YYYY-MM-DD|YYYY-MM-DD,不传时默认取昨天",
37
24
  "default": ""
38
25
  },
39
26
  {
40
27
  "name": "effectiveMetricPeriodLabel",
41
28
  "type": "string",
42
- "description": "内部派生的实际生效周期标签;请求“昨天”时,06:00 前会变成“前天”"
29
+ "description": "内部派生的实际生效周期标签"
43
30
  },
44
31
  {
45
32
  "name": "effectiveDateRange",
@@ -50,6 +37,12 @@
50
37
  "name": "returnHostPatterns",
51
38
  "type": "array",
52
39
  "description": "任务结束后若存在匹配这些 host 或 URL 片段的标签页,则切回该标签页"
40
+ },
41
+ {
42
+ "name": "device",
43
+ "type": "number",
44
+ "description": "设备维度参数,默认 0",
45
+ "default": 0
53
46
  }
54
47
  ],
55
48
  "nodes": [
@@ -69,72 +62,10 @@
69
62
  "tool": "validate_page",
70
63
  "args": {}
71
64
  },
72
- {
73
- "nodeId": "s2b",
74
- "name": "prepare_realtime_metrics",
75
- "goal": "先切换到其他粒度,确保再切回目标粒度时会触发刷新",
76
- "when": "equals(payload.invokeDirectly, false)",
77
- "tool": "trigger_action",
78
- "args": {
79
- "action": "refresh_live_metrics",
80
- "locators": [
81
- {
82
- "kind": "xpath",
83
- "value": "//span[normalize-space(.)='数据概览']/ancestor::div[contains(@class,'pro-layout-card-header__content')][1]//div[contains(@class,'oui-date-picker-particle-button')]//button[.//span[translate(normalize-space(.), ' ', '')='日']]",
84
- "priority": 1
85
- }
86
- ]
87
- }
88
- },
89
65
  {
90
66
  "nodeId": "s3",
91
- "name": "refresh_live_metrics",
92
- "goal": "点击指定时间粒度按钮并开启首页指标接口捕获",
93
- "when": "equals(payload.invokeDirectly, false)",
94
- "tool": "trigger_action",
95
- "args": {
96
- "action": "refresh_live_metrics",
97
- "locators": [
98
- {
99
- "kind": "xpath",
100
- "value": "//span[normalize-space(.)='数据概览']/ancestor::div[contains(@class,'pro-layout-card-header__content')][1]//div[contains(@class,'oui-date-picker-particle-button')]//button[.//span[translate(normalize-space(.), ' ', '')='{{data.metricPeriodLabel}}']]",
101
- "priority": 1
102
- }
103
- ],
104
- "captureNetwork": {
105
- "urlPattern": "https://sycm.taobao.com/portal/",
106
- "method": "GET",
107
- "timeoutMs": 15000,
108
- "capability": "hybrid",
109
- "operation": "capture_response",
110
- "persistent": true,
111
- "startPhase": "before_action",
112
- "actionScope": "node",
113
- "artifactType": "hybrid",
114
- "includeBody": true,
115
- "locationSuffix": "sycm_live_metrics",
116
- "hint": "capture sycm home realtime metrics"
117
- }
118
- }
119
- },
120
- {
121
- "nodeId": "s4",
122
- "name": "collect_live_metrics",
123
- "goal": "整合首页概览与趋势接口为统一结构化结果",
124
- "when": "equals(payload.invokeDirectly, false)",
125
- "tool": "collect_structured_data",
126
- "args": {
127
- "extractor": "live_metrics",
128
- "sourceNodeId": "s3"
129
- },
130
- "storeAs": "liveMetrics",
131
- "outputs": ["liveMetrics"]
132
- },
133
- {
134
- "nodeId": "s3p",
135
- "name": "show_live_metrics_direct_activity",
136
- "goal": "在页面顶部展示独立提示,标记当前正在直调首页指标接口",
137
- "when": "equals(payload.invokeDirectly, true)",
67
+ "name": "show_live_metrics_activity",
68
+ "goal": "在页面顶部展示独立提示,标记当前正在采集首页指标接口",
138
69
  "tool": "present_page_activity",
139
70
  "args": {
140
71
  "mode": "start",
@@ -145,81 +76,70 @@
145
76
  }
146
77
  },
147
78
  {
148
- "nodeId": "s3a",
79
+ "nodeId": "s4",
149
80
  "name": "invoke_live_metrics_overview",
150
- "goal": "在当前页面会话内直接调用首页概览接口",
151
- "when": "equals(payload.invokeDirectly, true)",
81
+ "goal": "在当前页面会话内直接调用实时概览接口",
82
+ "when": "equals(payload.requestDateType, 'today')",
152
83
  "tool": "invoke_page_request",
153
84
  "args": {
154
85
  "sourceId": "live_metrics_overview",
155
86
  "payload": {
156
- "dateType": "{{data.requestDateType}}",
157
- "dateRange": "{{data.requestDateRange}}"
158
- },
159
- "captureNetwork": {
160
- "urlPattern": "https://sycm.taobao.com/portal/",
161
- "method": "GET",
162
- "timeoutMs": 15000,
163
- "capability": "hybrid",
164
- "operation": "capture_response",
165
- "artifactType": "hybrid",
166
- "includeBody": true,
167
- "locationSuffix": "sycm_live_metrics_overview_request",
168
- "hint": "invoke sycm overview request"
87
+ "dateType": "{{data.requestDateType}}"
169
88
  }
170
89
  }
171
90
  },
172
91
  {
173
- "nodeId": "s3b",
92
+ "nodeId": "s5",
174
93
  "name": "invoke_live_metrics_trend",
175
- "goal": "在当前页面会话内直接调用首页趋势接口",
176
- "when": "equals(payload.invokeDirectly, true)",
94
+ "goal": "在当前页面会话内直接调用实时趋势接口",
95
+ "when": "equals(payload.requestDateType, 'today')",
177
96
  "tool": "invoke_page_request",
178
97
  "args": {
179
98
  "sourceId": "live_metrics_trend",
180
99
  "payload": {
181
- "dateType": "{{data.requestDateType}}",
182
- "dateRange": "{{data.requestDateRange}}"
183
- },
184
- "captureNetwork": {
185
- "urlPattern": "https://sycm.taobao.com/portal/",
186
- "method": "GET",
187
- "timeoutMs": 15000,
188
- "capability": "hybrid",
189
- "operation": "capture_response",
190
- "artifactType": "hybrid",
191
- "includeBody": true,
192
- "locationSuffix": "sycm_live_metrics_trend_request",
193
- "hint": "invoke sycm trend request"
100
+ "dateType": "{{data.requestDateType}}"
101
+ }
102
+ }
103
+ },
104
+ {
105
+ "nodeId": "s4c",
106
+ "name": "invoke_live_metrics_custom_overview",
107
+ "goal": "在当前页面会话内直接调用自定义时间概览接口",
108
+ "when": "notEquals(payload.requestDateType, 'today')",
109
+ "tool": "invoke_page_request",
110
+ "args": {
111
+ "sourceId": "live_metrics_custom_overview",
112
+ "payload": {
113
+ "dateRange": "{{data.requestDateRange}}",
114
+ "device": "{{data.device}}"
194
115
  }
195
116
  }
196
117
  },
197
118
  {
198
- "nodeId": "s4b",
199
- "name": "collect_live_metrics_direct",
200
- "goal": "整合页面会话内直接调用的概览与趋势响应",
201
- "when": "equals(payload.invokeDirectly, true)",
202
- "tool": "collect_structured_data",
119
+ "nodeId": "s5c",
120
+ "name": "invoke_live_metrics_custom_trend",
121
+ "goal": "在当前页面会话内直接调用自定义时间趋势接口",
122
+ "when": "notEquals(payload.requestDateType, 'today')",
123
+ "tool": "invoke_page_request",
203
124
  "args": {
204
- "extractor": "live_metrics_direct",
205
- "overviewNodeId": "s3a",
206
- "trendNodeId": "s3b"
207
- },
208
- "storeAs": "liveMetrics",
209
- "outputs": ["liveMetrics"]
125
+ "sourceId": "live_metrics_custom_trend",
126
+ "payload": {
127
+ "dateRange": "{{data.requestDateRange}}",
128
+ "device": "{{data.device}}"
129
+ }
130
+ }
210
131
  },
211
132
  {
212
- "nodeId": "s4c",
213
- "name": "hide_live_metrics_direct_activity",
214
- "goal": "在首页指标直调链路结束后关闭页面提示",
215
- "when": "equals(payload.invokeDirectly, true)",
133
+ "nodeId": "s6",
134
+ "name": "hide_live_metrics_activity",
135
+ "goal": "在首页指标采集结束后关闭页面提示",
216
136
  "tool": "present_page_activity",
217
137
  "args": {
218
138
  "mode": "stop"
219
139
  }
220
140
  },
221
141
  {
222
- "nodeId": "s5",
142
+ "nodeId": "s7",
223
143
  "name": "switch_to_existing_host_tab",
224
144
  "goal": "任务结束后若存在匹配的既有标签页则切回去",
225
145
  "when": "exists(payload.returnHostPatterns)",