assistsx-js 0.1.41 → 0.2.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 (104) hide show
  1. package/README.md +32 -0
  2. package/dist/index.cjs +7957 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.mts +4231 -0
  5. package/dist/index.d.ts +4231 -30
  6. package/dist/index.global.js +46 -0
  7. package/dist/index.global.js.map +1 -0
  8. package/dist/index.js +7879 -30
  9. package/dist/index.js.map +1 -0
  10. package/package.json +11 -5
  11. package/src/{AssistsXAsync.ts → assistsx-async.ts} +8 -8
  12. package/src/{AssistsX.ts → assistsx.ts} +8 -8
  13. package/src/barutils/bar-utils.ts +3 -3
  14. package/src/filesystem/fileio/file-io.ts +2 -2
  15. package/src/filesystem/fileutils/file-utils.ts +2 -2
  16. package/src/filesystem/path.ts +2 -2
  17. package/src/floatingwindow/float.ts +4 -4
  18. package/src/gallery/gallery.ts +2 -2
  19. package/src/global.d.ts +6 -1
  20. package/src/imageutils/image-utils.ts +2 -2
  21. package/src/ime/ime.ts +2 -2
  22. package/src/index.ts +21 -20
  23. package/src/log/log-call-method.ts +28 -0
  24. package/src/log/log.ts +445 -0
  25. package/src/mlkit/mlkit.ts +3 -3
  26. package/src/network/http.ts +2 -2
  27. package/src/{NodeAsync.ts → node-async.ts} +5 -5
  28. package/src/{Node.ts → node.ts} +5 -5
  29. package/src/{StepAsync.ts → step-async.ts} +8 -8
  30. package/src/{Step.ts → step.ts} +7 -7
  31. package/dist/AccessibilityEventFilter.d.ts +0 -105
  32. package/dist/AccessibilityEventFilter.js +0 -89
  33. package/dist/AppInfo.d.ts +0 -45
  34. package/dist/AppInfo.js +0 -38
  35. package/dist/AssistsX.d.ts +0 -484
  36. package/dist/AssistsX.js +0 -828
  37. package/dist/AssistsXAsync.d.ts +0 -532
  38. package/dist/AssistsXAsync.js +0 -874
  39. package/dist/Bounds.d.ts +0 -48
  40. package/dist/Bounds.js +0 -68
  41. package/dist/CallMethod.d.ts +0 -69
  42. package/dist/CallMethod.js +0 -71
  43. package/dist/CallResponse.d.ts +0 -10
  44. package/dist/CallResponse.js +0 -28
  45. package/dist/DeviceInfo.d.ts +0 -69
  46. package/dist/DeviceInfo.js +0 -50
  47. package/dist/Node.d.ts +0 -334
  48. package/dist/Node.js +0 -369
  49. package/dist/NodeAsync.d.ts +0 -213
  50. package/dist/NodeAsync.js +0 -313
  51. package/dist/NodeClassValue.d.ts +0 -15
  52. package/dist/NodeClassValue.js +0 -15
  53. package/dist/Step.d.ts +0 -355
  54. package/dist/Step.js +0 -689
  55. package/dist/StepAsync.d.ts +0 -162
  56. package/dist/StepAsync.js +0 -264
  57. package/dist/StepError.d.ts +0 -35
  58. package/dist/StepError.js +0 -26
  59. package/dist/StepStateStore.d.ts +0 -14
  60. package/dist/StepStateStore.js +0 -37
  61. package/dist/Utils.d.ts +0 -3
  62. package/dist/Utils.js +0 -20
  63. package/dist/WindowFlags.d.ts +0 -75
  64. package/dist/WindowFlags.js +0 -97
  65. package/dist/barutils/BarUtilsCallMethod.d.ts +0 -24
  66. package/dist/barutils/BarUtilsCallMethod.js +0 -26
  67. package/dist/barutils/bar-utils.d.ts +0 -41
  68. package/dist/barutils/bar-utils.js +0 -205
  69. package/dist/filesystem/fileio/file-io.d.ts +0 -101
  70. package/dist/filesystem/fileio/file-io.js +0 -235
  71. package/dist/filesystem/fileutils/file-utils.d.ts +0 -242
  72. package/dist/filesystem/fileutils/file-utils.js +0 -493
  73. package/dist/filesystem/path.d.ts +0 -252
  74. package/dist/filesystem/path.js +0 -589
  75. package/dist/floatingwindow/FloatCallMethod.d.ts +0 -19
  76. package/dist/floatingwindow/FloatCallMethod.js +0 -18
  77. package/dist/floatingwindow/float.d.ts +0 -29
  78. package/dist/floatingwindow/float.js +0 -149
  79. package/dist/gallery/gallery.d.ts +0 -60
  80. package/dist/gallery/gallery.js +0 -142
  81. package/dist/imageutils/image-utils.d.ts +0 -442
  82. package/dist/imageutils/image-utils.js +0 -543
  83. package/dist/ime/ime.d.ts +0 -80
  84. package/dist/ime/ime.js +0 -141
  85. package/dist/mlkit/MlkitCallMethod.d.ts +0 -27
  86. package/dist/mlkit/MlkitCallMethod.js +0 -26
  87. package/dist/mlkit/mlkit.d.ts +0 -86
  88. package/dist/mlkit/mlkit.js +0 -169
  89. package/dist/network/http.d.ts +0 -127
  90. package/dist/network/http.js +0 -202
  91. /package/src/{AccessibilityEventFilter.ts → accessibility-event-filter.ts} +0 -0
  92. /package/src/{AppInfo.ts → app-info.ts} +0 -0
  93. /package/src/barutils/{BarUtilsCallMethod.ts → bar-utils-call-method.ts} +0 -0
  94. /package/src/{Bounds.ts → bounds.ts} +0 -0
  95. /package/src/{CallMethod.ts → call-method.ts} +0 -0
  96. /package/src/{CallResponse.ts → call-response.ts} +0 -0
  97. /package/src/{DeviceInfo.ts → device-info.ts} +0 -0
  98. /package/src/floatingwindow/{FloatCallMethod.ts → float-call-method.ts} +0 -0
  99. /package/src/mlkit/{MlkitCallMethod.ts → mlkit-call-method.ts} +0 -0
  100. /package/src/{NodeClassValue.ts → node-class-value.ts} +0 -0
  101. /package/src/{StepError.ts → step-error.ts} +0 -0
  102. /package/src/{StepStateStore.ts → step-state-store.ts} +0 -0
  103. /package/src/{Utils.ts → utils.ts} +0 -0
  104. /package/src/{WindowFlags.ts → window-flags.ts} +0 -0
package/package.json CHANGED
@@ -1,26 +1,31 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.1.41",
3
+ "version": "0.2.0",
4
4
  "description": "assistsx-js自动化开发SDK",
5
- "main": "dist/index.js",
5
+ "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "unpkg": "dist/index.global.js",
9
+ "jsdelivr": "dist/index.global.js",
8
10
  "files": [
9
11
  "dist",
10
12
  "src"
11
13
  ],
12
14
  "exports": {
13
15
  ".": {
16
+ "types": "./dist/index.d.ts",
14
17
  "import": "./dist/index.js",
15
- "require": "./dist/index.js",
16
- "types": "./dist/index.d.ts"
18
+ "require": "./dist/index.cjs"
19
+ },
20
+ "./global": {
21
+ "default": "./dist/index.global.js"
17
22
  }
18
23
  },
19
24
  "publishConfig": {
20
25
  "access": "public"
21
26
  },
22
27
  "scripts": {
23
- "build": "tsc",
28
+ "build": "tsup",
24
29
  "prepublish": "npm run build",
25
30
  "test": "echo \"Error: no test specified\" && exit 1"
26
31
  },
@@ -35,6 +40,7 @@
35
40
  "author": "Ven",
36
41
  "license": "MIT",
37
42
  "devDependencies": {
43
+ "tsup": "^8.5.0",
38
44
  "typescript": "^5.3.3"
39
45
  },
40
46
  "dependencies": {
@@ -2,18 +2,18 @@
2
2
  * AssistsX 类
3
3
  * 提供与移动应用程序界面交互的工具类,包括节点查找、手势操作、屏幕操作等功能
4
4
  */
5
- import { Node } from "./Node";
6
- import { CallMethod } from "./CallMethod";
7
- import { CallResponse } from "./CallResponse";
8
- import { Bounds } from "./Bounds";
9
- import { generateUUID } from "./Utils";
10
- import { AppInfo } from "./AppInfo";
11
- import { DeviceInfo } from "./DeviceInfo";
5
+ import { Node } from "./node";
6
+ import { CallMethod } from "./call-method";
7
+ import { CallResponse } from "./call-response";
8
+ import { Bounds } from "./bounds";
9
+ import { generateUUID } from "./utils";
10
+ import { AppInfo } from "./app-info";
11
+ import { DeviceInfo } from "./device-info";
12
12
  import {
13
13
  AssistsX,
14
14
  callbacks,
15
15
  WebFloatingWindowOptions,
16
- } from "./AssistsX";
16
+ } from "./assistsx";
17
17
 
18
18
  /**
19
19
  * 截图识别位置信息
@@ -2,14 +2,14 @@
2
2
  * AssistsX 类
3
3
  * 提供与移动应用程序界面交互的工具类,包括节点查找、手势操作、屏幕操作等功能
4
4
  */
5
- import { Node } from "./Node";
6
- import { CallMethod } from "./CallMethod";
7
- import { CallResponse } from "./CallResponse";
8
- import { Bounds } from "./Bounds";
9
- import { decodeBase64UTF8, generateUUID } from "./Utils";
10
- import { AccessibilityEventFilter } from "AccessibilityEventFilter";
11
- import { AppInfo } from "./AppInfo";
12
- import { DeviceInfo } from "./DeviceInfo";
5
+ import { Node } from "./node";
6
+ import { CallMethod } from "./call-method";
7
+ import { CallResponse } from "./call-response";
8
+ import { Bounds } from "./bounds";
9
+ import { decodeBase64UTF8, generateUUID } from "./utils";
10
+ import { AccessibilityEventFilter } from "./accessibility-event-filter";
11
+ import { AppInfo } from "./app-info";
12
+ import { DeviceInfo } from "./device-info";
13
13
 
14
14
  /**
15
15
  * 无障碍事件数据结构
@@ -2,9 +2,9 @@
2
2
  * Bar utils (status bar, nav bar, action bar) for WebView.
3
3
  * Requires Activity context on native side. Matches BarUtilsJavascriptInterface.kt.
4
4
  */
5
- import { CallResponse } from "../CallResponse";
6
- import { decodeBase64UTF8, generateUUID } from "../Utils";
7
- import { BarUtilsCallMethod } from "./BarUtilsCallMethod";
5
+ import { CallResponse } from "../call-response";
6
+ import { decodeBase64UTF8, generateUUID } from "../utils";
7
+ import { BarUtilsCallMethod } from "./bar-utils-call-method";
8
8
 
9
9
  const callbacks: Map<string, (data: string) => void> = new Map();
10
10
 
@@ -2,8 +2,8 @@
2
2
  * 文件IO相关功能
3
3
  * 提供文件读写相关的功能
4
4
  */
5
- import { CallResponse } from "../../CallResponse";
6
- import { decodeBase64UTF8, generateUUID } from "../../Utils";
5
+ import { CallResponse } from "../../call-response";
6
+ import { decodeBase64UTF8, generateUUID } from "../../utils";
7
7
 
8
8
  // 回调函数存储对象
9
9
  const callbacks: Map<string, (data: string) => void> = new Map();
@@ -2,8 +2,8 @@
2
2
  * 文件工具相关功能
3
3
  * 提供文件操作相关的功能
4
4
  */
5
- import { CallResponse } from "../../CallResponse";
6
- import { decodeBase64UTF8, generateUUID } from "../../Utils";
5
+ import { CallResponse } from "../../call-response";
6
+ import { decodeBase64UTF8, generateUUID } from "../../utils";
7
7
 
8
8
  /**
9
9
  * 文件信息接口定义
@@ -2,8 +2,8 @@
2
2
  * 路径相关功能
3
3
  * 提供文件系统路径相关的功能
4
4
  */
5
- import { CallResponse } from "../CallResponse";
6
- import { decodeBase64UTF8, generateUUID } from "../Utils";
5
+ import { CallResponse } from "../call-response";
6
+ import { decodeBase64UTF8, generateUUID } from "../utils";
7
7
 
8
8
  // 回调函数存储对象
9
9
  const callbacks: Map<string, (data: string) => void> = new Map();
@@ -2,10 +2,10 @@
2
2
  * Float window API for WebView.
3
3
  * Requires assistsxFloat native bridge. Matches FloatJsInterface.kt.
4
4
  */
5
- import { CallResponse } from "../CallResponse";
6
- import { decodeBase64UTF8, generateUUID } from "../Utils";
7
- import { FloatCallMethod } from "./FloatCallMethod";
8
- import type { WebFloatingWindowOptions } from "../AssistsX";
5
+ import { CallResponse } from "../call-response";
6
+ import { decodeBase64UTF8, generateUUID } from "../utils";
7
+ import { FloatCallMethod } from "./float-call-method";
8
+ import type { WebFloatingWindowOptions } from "../assistsx";
9
9
 
10
10
  const callbacks: Map<string, (data: string) => void> = new Map();
11
11
 
@@ -2,8 +2,8 @@
2
2
  * 系统相册相关功能
3
3
  * 提供添加图片/视频到相册和从相册删除的功能
4
4
  */
5
- import { CallResponse } from "../CallResponse";
6
- import { decodeBase64UTF8, generateUUID } from "../Utils";
5
+ import { CallResponse } from "../call-response";
6
+ import { decodeBase64UTF8, generateUUID } from "../utils";
7
7
 
8
8
  /**
9
9
  * 相册操作响应接口定义
package/src/global.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Node } from "./Node";
1
+ import { Node } from "./node";
2
2
 
3
3
  // 扩展 Window 接口
4
4
  declare global {
@@ -51,6 +51,11 @@ declare global {
51
51
  call(method: string): string | null;
52
52
  };
53
53
  assistsxFloatCallback: (data: string) => void;
54
+ assistsxLog: {
55
+ call(method: string): string | null;
56
+ };
57
+ assistsxLogCallback: (data: string) => void;
58
+ onAssistsLogUpdate: (encoded: string) => void;
54
59
  }
55
60
  }
56
61
 
@@ -2,8 +2,8 @@
2
2
  * 图片工具相关功能
3
3
  * 提供图片处理相关的功能,包括转换、处理、压缩、保存等
4
4
  */
5
- import { CallResponse } from "../CallResponse";
6
- import { decodeBase64UTF8, generateUUID } from "../Utils";
5
+ import { CallResponse } from "../call-response";
6
+ import { decodeBase64UTF8, generateUUID } from "../utils";
7
7
 
8
8
  /**
9
9
  * 图片尺寸信息
package/src/ime/ime.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * 输入法相关功能
3
3
  * 提供输入法操作相关的功能,如执行编辑器动作(搜索等)
4
4
  */
5
- import { CallResponse } from "../CallResponse";
6
- import { decodeBase64UTF8, generateUUID } from "../Utils";
5
+ import { CallResponse } from "../call-response";
6
+ import { decodeBase64UTF8, generateUUID } from "../utils";
7
7
 
8
8
  /**
9
9
  * IME 动作 ID 常量
package/src/index.ts CHANGED
@@ -1,20 +1,20 @@
1
- export * from "./AssistsX";
2
- export * from "./Node";
3
- export * from "./CallMethod";
4
- export * from "./CallResponse";
5
- export * from "./NodeClassValue";
6
- export * from "./Utils";
7
- export * from "./Bounds";
8
- export * from "./Step";
9
- export * from "./StepStateStore";
10
- export * from "./WindowFlags";
11
- export * from "./NodeAsync";
12
- export * from "./AssistsXAsync";
13
- export * from "./StepAsync";
14
- export * from "./AccessibilityEventFilter";
15
- export * from "./AppInfo";
16
- export * from "./DeviceInfo";
17
- export * from "./StepError";
1
+ export * from "./assistsx";
2
+ export * from "./node";
3
+ export * from "./call-method";
4
+ export * from "./call-response";
5
+ export * from "./node-class-value";
6
+ export * from "./utils";
7
+ export * from "./bounds";
8
+ export * from "./step";
9
+ export * from "./step-state-store";
10
+ export * from "./window-flags";
11
+ export * from "./node-async";
12
+ export * from "./assistsx-async";
13
+ export * from "./step-async";
14
+ export * from "./accessibility-event-filter";
15
+ export * from "./app-info";
16
+ export * from "./device-info";
17
+ export * from "./step-error";
18
18
  export * from "./network/http";
19
19
  export * from "./filesystem/path";
20
20
  export * from "./filesystem/fileio/file-io";
@@ -23,8 +23,9 @@ export * from "./ime/ime";
23
23
  export * from "./imageutils/image-utils";
24
24
  export * from "./gallery/gallery";
25
25
  export * from "./mlkit/mlkit";
26
- export * from "./mlkit/MlkitCallMethod";
26
+ export * from "./mlkit/mlkit-call-method";
27
27
  export * from "./barutils/bar-utils";
28
- export * from "./barutils/BarUtilsCallMethod";
28
+ export * from "./barutils/bar-utils-call-method";
29
29
  export * from "./floatingwindow/float";
30
- export * from "./floatingwindow/FloatCallMethod";
30
+ export * from "./floatingwindow/float-call-method";
31
+ export * from "./log/log";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 日志桥接方法名(与 tools/log/AssistsLogCallMethod.kt 一致)
3
+ */
4
+ export const LogCallMethod = {
5
+ readAllText: "readAllText",
6
+ clear: "clear",
7
+ refreshFromFile: "refreshFromFile",
8
+ appendLine: "appendLine",
9
+ appendTimestampedEntry: "appendTimestampedEntry",
10
+ replaceAll: "replaceAll",
11
+ subscribe: "subscribe",
12
+ unsubscribe: "unsubscribe",
13
+ uploadLogs: "uploadLogs",
14
+
15
+ /** 获取日志服务当前域名(origin,无路径;与上传、管理后台同源),对应 AssistsLogDiagnostics.adminWebBaseUrl() */
16
+ getLogServiceBaseUrl: "getLogServiceBaseUrl",
17
+ } as const;
18
+
19
+ /** 与 ASWebView / AssistsLogJavascriptInterface companion 对齐 */
20
+ export const LogStream = {
21
+ latestLine: "latestLine",
22
+ entireLogText: "entireLogText",
23
+ } as const;
24
+
25
+ export type LogStreamType = (typeof LogStream)[keyof typeof LogStream];
26
+
27
+ export type LogCallMethodType =
28
+ (typeof LogCallMethod)[keyof typeof LogCallMethod];