@xbrowser/cli 0.14.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.
Files changed (55) hide show
  1. package/README.md +858 -0
  2. package/dist/admin-6UTU2RZ2.js +281 -0
  3. package/dist/admin-MDGF4CET.js +285 -0
  4. package/dist/admin-RPJJ5CAF.js +282 -0
  5. package/dist/browser-GWBH6OJK.js +46 -0
  6. package/dist/browser-I2HJZ7IP.js +48 -0
  7. package/dist/browser-R7B255ML.js +46 -0
  8. package/dist/chunk-2ONMTDLK.js +2050 -0
  9. package/dist/chunk-3RG5ZIWI.js +10 -0
  10. package/dist/chunk-43VX3TYN.js +83 -0
  11. package/dist/chunk-ATFTAKMN.js +267 -0
  12. package/dist/chunk-DESA2KMG.js +77 -0
  13. package/dist/chunk-DTJRVA76.js +206 -0
  14. package/dist/chunk-F3ZWFCJJ.js +2051 -0
  15. package/dist/chunk-FF5WHQHN.js +135 -0
  16. package/dist/chunk-HINTG75P.js +77 -0
  17. package/dist/chunk-KDYXFLAC.js +1503 -0
  18. package/dist/chunk-KTSQU4QT.js +29 -0
  19. package/dist/chunk-L53IDAWK.js +68 -0
  20. package/dist/chunk-M7CMBPCA.js +100 -0
  21. package/dist/chunk-NFGO7J2I.js +29 -0
  22. package/dist/chunk-OLB6UJ25.js +438 -0
  23. package/dist/chunk-OPRXFZVE.js +52 -0
  24. package/dist/chunk-RS6YYWTK.js +685 -0
  25. package/dist/chunk-VEDJ5XSQ.js +196 -0
  26. package/dist/chunk-VEKPHQBR.js +47 -0
  27. package/dist/chunk-VUJDJCIN.js +437 -0
  28. package/dist/chunk-YEN2ODUI.js +14 -0
  29. package/dist/chunk-ZZ2TFWIV.js +1382 -0
  30. package/dist/cli.js +11012 -0
  31. package/dist/convert-4DUWZIKH.js +205 -0
  32. package/dist/convert-EKQVHKB4.js +11 -0
  33. package/dist/daemon-client-3IJD6X4B.js +59 -0
  34. package/dist/daemon-client-GX2UYIW4.js +241 -0
  35. package/dist/daemon-client-XWSSQBEA.js +58 -0
  36. package/dist/daemon-main.js +9910 -0
  37. package/dist/extract-EGRXZSSK.js +67 -0
  38. package/dist/extract-JUOQQX4V.js +11 -0
  39. package/dist/filter-OLAE26HN.js +51 -0
  40. package/dist/filter-VID2GGZ7.js +9 -0
  41. package/dist/human-interaction-QPHNDD76.js +8 -0
  42. package/dist/index.d.ts +2313 -0
  43. package/dist/index.js +13839 -0
  44. package/dist/marketplace-FCVN5OTZ.js +706 -0
  45. package/dist/marketplace-FPT5YLKB.js +351 -0
  46. package/dist/marketplace-W545W4FR.js +706 -0
  47. package/dist/network-store-2S5HATEV.js +194 -0
  48. package/dist/network-store-BN6QEZ7R.js +196 -0
  49. package/dist/network-store-YAF5OIBH.js +12 -0
  50. package/dist/parse-action-dsl-DRSPBALP.js +72 -0
  51. package/dist/parse-action-dsl-T3DYC33D.js +74 -0
  52. package/dist/proxy-WKGUCH2C.js +7 -0
  53. package/dist/session-recorder-ILSSV2UC.js +6 -0
  54. package/dist/session-recorder-XET3DNML.js +7 -0
  55. package/package.json +111 -0
@@ -0,0 +1,52 @@
1
+ // src/commands/filter.ts
2
+ import * as fs from "fs";
3
+ import * as yaml from "yaml";
4
+ var DEFAULT_EXCLUDE_TYPES = [
5
+ "panel_item_added",
6
+ "panel_debug",
7
+ "panel_items_count",
8
+ "panel_debug_detail",
9
+ "element_at_position",
10
+ "element_at_click",
11
+ "navigation",
12
+ "panel_appeared",
13
+ "panel_items",
14
+ "blur",
15
+ "focus",
16
+ "dom_change",
17
+ "tab_open",
18
+ "click_inferred",
19
+ "pointerup",
20
+ "pointerdown",
21
+ "mouseup",
22
+ "mousedown"
23
+ ];
24
+ function filterRecording(inputPath, outputPath, excludeTypes) {
25
+ const content = fs.readFileSync(inputPath, "utf-8");
26
+ const recording = yaml.parse(content);
27
+ const exclude = excludeTypes || DEFAULT_EXCLUDE_TYPES;
28
+ const events = recording.events || [];
29
+ const originalCount = events.length;
30
+ const filteredEvents = events.filter((event) => {
31
+ return !exclude.includes(event.type);
32
+ });
33
+ const filteredCount = filteredEvents.length;
34
+ const removed = originalCount - filteredCount;
35
+ const percentage = originalCount > 0 ? Math.round(removed / originalCount * 100) : 0;
36
+ const output = { ...recording, events: filteredEvents };
37
+ fs.writeFileSync(outputPath, yaml.stringify(output));
38
+ return { originalCount, filteredCount, removed, percentage };
39
+ }
40
+ function parseExcludeTypes(args) {
41
+ for (const arg of args) {
42
+ if (arg.startsWith("--exclude-types=")) {
43
+ return arg.replace("--exclude-types=", "").split(",");
44
+ }
45
+ }
46
+ return void 0;
47
+ }
48
+
49
+ export {
50
+ filterRecording,
51
+ parseExcludeTypes
52
+ };