@ff-labs/fff-node 0.10.7-nightly.f3647b7 → 0.11.0

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
@@ -1058,11 +1058,11 @@ function ffiSearchMixed(handle, query, currentFile, maxThreads, pageIndex, pageS
1058
1058
  });
1059
1059
  return parseMixedSearchResult(rawPtr);
1060
1060
  }
1061
- function ffiLiveGrep(handle, query, mode, maxFileSize, maxMatchesPerFile, smartCase, fileOffset, pageLimit, timeBudgetMs, beforeContext, afterContext, classifyDefinitions) {
1061
+ function ffiLiveGrep(handle, query, mode, maxFileSize, maxMatchesPerFile, smartCase, fileOffset, pageLimit, timeBudgetMs, enforceTimeBudget, beforeContext, afterContext, classifyDefinitions) {
1062
1062
  loadLibrary();
1063
1063
  const rawPtr = load({
1064
1064
  library: LIBRARY_KEY,
1065
- funcName: "fff_live_grep",
1065
+ funcName: "fff_live_grep_ex",
1066
1066
  retType: DataType.External,
1067
1067
  paramsType: [
1068
1068
  DataType.External,
@@ -1083,6 +1083,8 @@ function ffiLiveGrep(handle, query, mode, maxFileSize, maxMatchesPerFile, smartC
1083
1083
  // page_limit
1084
1084
  DataType.U64,
1085
1085
  // time_budget_ms
1086
+ DataType.Boolean,
1087
+ // enforce_time_budget
1086
1088
  DataType.U32,
1087
1089
  // before_context
1088
1090
  DataType.U32,
@@ -1100,6 +1102,7 @@ function ffiLiveGrep(handle, query, mode, maxFileSize, maxMatchesPerFile, smartC
1100
1102
  fileOffset,
1101
1103
  pageLimit,
1102
1104
  timeBudgetMs,
1105
+ enforceTimeBudget,
1103
1106
  beforeContext,
1104
1107
  afterContext,
1105
1108
  classifyDefinitions
@@ -1108,11 +1111,11 @@ function ffiLiveGrep(handle, query, mode, maxFileSize, maxMatchesPerFile, smartC
1108
1111
  });
1109
1112
  return parseGrepResult(rawPtr);
1110
1113
  }
1111
- function ffiMultiGrep(handle, patternsJoined, constraints, maxFileSize, maxMatchesPerFile, smartCase, fileOffset, pageLimit, timeBudgetMs, beforeContext, afterContext, classifyDefinitions) {
1114
+ function ffiMultiGrep(handle, patternsJoined, constraints, maxFileSize, maxMatchesPerFile, smartCase, fileOffset, pageLimit, timeBudgetMs, enforceTimeBudget, beforeContext, afterContext, classifyDefinitions) {
1112
1115
  loadLibrary();
1113
1116
  const rawPtr = load({
1114
1117
  library: LIBRARY_KEY,
1115
- funcName: "fff_multi_grep",
1118
+ funcName: "fff_multi_grep_ex",
1116
1119
  retType: DataType.External,
1117
1120
  paramsType: [
1118
1121
  DataType.External,
@@ -1133,6 +1136,8 @@ function ffiMultiGrep(handle, patternsJoined, constraints, maxFileSize, maxMatch
1133
1136
  // page_limit
1134
1137
  DataType.U64,
1135
1138
  // time_budget_ms
1139
+ DataType.Boolean,
1140
+ // enforce_time_budget
1136
1141
  DataType.U32,
1137
1142
  // before_context
1138
1143
  DataType.U32,
@@ -1150,6 +1155,7 @@ function ffiMultiGrep(handle, patternsJoined, constraints, maxFileSize, maxMatch
1150
1155
  fileOffset,
1151
1156
  pageLimit,
1152
1157
  timeBudgetMs,
1158
+ enforceTimeBudget,
1153
1159
  beforeContext,
1154
1160
  afterContext,
1155
1161
  classifyDefinitions
@@ -1245,6 +1251,8 @@ function watchKindFromU8(kind) {
1245
1251
  return "modified";
1246
1252
  case 2:
1247
1253
  return "removed";
1254
+ case 4:
1255
+ return "renamed";
1248
1256
  default:
1249
1257
  return "rescan";
1250
1258
  }
@@ -1290,10 +1298,22 @@ function consumeWatchBatch(address) {
1290
1298
  paramsType: [DataType.External, DataType.U32],
1291
1299
  paramsValue: [batchPtr, i]
1292
1300
  });
1293
- events.push({
1301
+ const event = {
1294
1302
  path: readCString(path) ?? "",
1295
1303
  kind: watchKindFromU8(kind)
1296
- });
1304
+ };
1305
+ if (event.kind === "renamed") {
1306
+ const from = load({
1307
+ library: LIBRARY_KEY,
1308
+ funcName: "fff_watch_events_get_from_path",
1309
+ retType: DataType.External,
1310
+ paramsType: [DataType.External, DataType.U32],
1311
+ paramsValue: [batchPtr, i]
1312
+ });
1313
+ const decoded = readCString(from);
1314
+ if (decoded) event.from = decoded;
1315
+ }
1316
+ events.push(event);
1297
1317
  }
1298
1318
  load({
1299
1319
  library: LIBRARY_KEY,
@@ -1673,6 +1693,7 @@ var FileFinder = class _FileFinder {
1673
1693
  options?.cursor?._offset ?? 0,
1674
1694
  options?.pageSize ?? 0,
1675
1695
  options?.timeBudgetMs ?? 0,
1696
+ options?.enforceTimeBudget ?? false,
1676
1697
  options?.beforeContext ?? 0,
1677
1698
  options?.afterContext ?? 0,
1678
1699
  options?.classifyDefinitions ?? false
@@ -1719,6 +1740,7 @@ var FileFinder = class _FileFinder {
1719
1740
  options.cursor?._offset ?? 0,
1720
1741
  options.pageSize ?? 0,
1721
1742
  options.timeBudgetMs ?? 0,
1743
+ options.enforceTimeBudget ?? false,
1722
1744
  options.beforeContext ?? 0,
1723
1745
  options.afterContext ?? 0,
1724
1746
  options.classifyDefinitions ?? false