@lark-apaas/devtool-kits 1.2.5-alpha.2 → 1.2.5-alpha.4

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/dist/index.js CHANGED
@@ -2121,10 +2121,7 @@ async function readTriggerList(filePath, trigger, path7, limit) {
2121
2121
  if (alreadyAdded) {
2122
2122
  return false;
2123
2123
  }
2124
- if (!builder.hasCompleted) {
2125
- return false;
2126
- }
2127
- const isAutomationTrigger = builder.path === path7;
2124
+ const isAutomationTrigger = builder.path?.endsWith(path7);
2128
2125
  if (!isAutomationTrigger) {
2129
2126
  return false;
2130
2127
  }
@@ -2147,7 +2144,7 @@ async function readTriggerList(filePath, trigger, path7, limit) {
2147
2144
  if (shouldIncludeInCompletedCalls(builder)) {
2148
2145
  completedCalls.push(builder);
2149
2146
  if (limit && completedCalls.length > limit) {
2150
- completedCalls.shift();
2147
+ completedCalls.pop();
2151
2148
  }
2152
2149
  }
2153
2150
  }, "updateBuilderMetadata");
@@ -2162,7 +2159,7 @@ async function readTriggerList(filePath, trigger, path7, limit) {
2162
2159
  if (shouldIncludeInCompletedCalls(builder)) {
2163
2160
  completedCalls.push(builder);
2164
2161
  if (limit && completedCalls.length > limit) {
2165
- completedCalls.shift();
2162
+ completedCalls.pop();
2166
2163
  }
2167
2164
  }
2168
2165
  }, "handleRequestCompleted");
@@ -2207,7 +2204,7 @@ async function readTriggerList(filePath, trigger, path7, limit) {
2207
2204
  };
2208
2205
  }
2209
2206
  __name(readTriggerList, "readTriggerList");
2210
- async function readTriggerDetail(filePath, instanceID) {
2207
+ async function readTriggerDetail(filePath, path7, instanceID) {
2211
2208
  const exists = await fileExists(filePath);
2212
2209
  if (!exists) {
2213
2210
  return void 0;
@@ -2223,8 +2220,9 @@ async function readTriggerDetail(filePath, instanceID) {
2223
2220
  for await (const line of rl) {
2224
2221
  const entry = parseLogLine2(line);
2225
2222
  if (!entry) continue;
2223
+ const isAutomationTrigger = entry.path?.endsWith(path7);
2226
2224
  const hasInstanceID = entry.message?.includes(`instanceID=${instanceID}`);
2227
- if (!hasInstanceID) continue;
2225
+ if (!isAutomationTrigger || !hasInstanceID) continue;
2228
2226
  matches.push(entry);
2229
2227
  }
2230
2228
  rl.close();
@@ -2364,8 +2362,9 @@ function createGetTriggerDetailHandler(logDir) {
2364
2362
  message: "instanceID is required"
2365
2363
  });
2366
2364
  }
2365
+ const path7 = typeof req.query.path === "string" ? req.query.path.trim() : "/__innerapi__/automation/invoke";
2367
2366
  try {
2368
- const result = await readTriggerDetail(traceLogPath, instanceID);
2367
+ const result = await readTriggerDetail(traceLogPath, path7, instanceID);
2369
2368
  if (!result) {
2370
2369
  return handleNotFound(res, traceLogPath);
2371
2370
  }