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.
- package/README.md +32 -0
- package/dist/index.cjs +7957 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +4231 -0
- package/dist/index.d.ts +4231 -30
- package/dist/index.global.js +46 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +7879 -30
- package/dist/index.js.map +1 -0
- package/package.json +11 -5
- package/src/{AssistsXAsync.ts → assistsx-async.ts} +8 -8
- package/src/{AssistsX.ts → assistsx.ts} +8 -8
- package/src/barutils/bar-utils.ts +3 -3
- package/src/filesystem/fileio/file-io.ts +2 -2
- package/src/filesystem/fileutils/file-utils.ts +2 -2
- package/src/filesystem/path.ts +2 -2
- package/src/floatingwindow/float.ts +4 -4
- package/src/gallery/gallery.ts +2 -2
- package/src/global.d.ts +6 -1
- package/src/imageutils/image-utils.ts +2 -2
- package/src/ime/ime.ts +2 -2
- package/src/index.ts +21 -20
- package/src/log/log-call-method.ts +28 -0
- package/src/log/log.ts +445 -0
- package/src/mlkit/mlkit.ts +3 -3
- package/src/network/http.ts +2 -2
- package/src/{NodeAsync.ts → node-async.ts} +5 -5
- package/src/{Node.ts → node.ts} +5 -5
- package/src/{StepAsync.ts → step-async.ts} +8 -8
- package/src/{Step.ts → step.ts} +7 -7
- package/dist/AccessibilityEventFilter.d.ts +0 -105
- package/dist/AccessibilityEventFilter.js +0 -89
- package/dist/AppInfo.d.ts +0 -45
- package/dist/AppInfo.js +0 -38
- package/dist/AssistsX.d.ts +0 -484
- package/dist/AssistsX.js +0 -828
- package/dist/AssistsXAsync.d.ts +0 -532
- package/dist/AssistsXAsync.js +0 -874
- package/dist/Bounds.d.ts +0 -48
- package/dist/Bounds.js +0 -68
- package/dist/CallMethod.d.ts +0 -69
- package/dist/CallMethod.js +0 -71
- package/dist/CallResponse.d.ts +0 -10
- package/dist/CallResponse.js +0 -28
- package/dist/DeviceInfo.d.ts +0 -69
- package/dist/DeviceInfo.js +0 -50
- package/dist/Node.d.ts +0 -334
- package/dist/Node.js +0 -369
- package/dist/NodeAsync.d.ts +0 -213
- package/dist/NodeAsync.js +0 -313
- package/dist/NodeClassValue.d.ts +0 -15
- package/dist/NodeClassValue.js +0 -15
- package/dist/Step.d.ts +0 -355
- package/dist/Step.js +0 -689
- package/dist/StepAsync.d.ts +0 -162
- package/dist/StepAsync.js +0 -264
- package/dist/StepError.d.ts +0 -35
- package/dist/StepError.js +0 -26
- package/dist/StepStateStore.d.ts +0 -14
- package/dist/StepStateStore.js +0 -37
- package/dist/Utils.d.ts +0 -3
- package/dist/Utils.js +0 -20
- package/dist/WindowFlags.d.ts +0 -75
- package/dist/WindowFlags.js +0 -97
- package/dist/barutils/BarUtilsCallMethod.d.ts +0 -24
- package/dist/barutils/BarUtilsCallMethod.js +0 -26
- package/dist/barutils/bar-utils.d.ts +0 -41
- package/dist/barutils/bar-utils.js +0 -205
- package/dist/filesystem/fileio/file-io.d.ts +0 -101
- package/dist/filesystem/fileio/file-io.js +0 -235
- package/dist/filesystem/fileutils/file-utils.d.ts +0 -242
- package/dist/filesystem/fileutils/file-utils.js +0 -493
- package/dist/filesystem/path.d.ts +0 -252
- package/dist/filesystem/path.js +0 -589
- package/dist/floatingwindow/FloatCallMethod.d.ts +0 -19
- package/dist/floatingwindow/FloatCallMethod.js +0 -18
- package/dist/floatingwindow/float.d.ts +0 -29
- package/dist/floatingwindow/float.js +0 -149
- package/dist/gallery/gallery.d.ts +0 -60
- package/dist/gallery/gallery.js +0 -142
- package/dist/imageutils/image-utils.d.ts +0 -442
- package/dist/imageutils/image-utils.js +0 -543
- package/dist/ime/ime.d.ts +0 -80
- package/dist/ime/ime.js +0 -141
- package/dist/mlkit/MlkitCallMethod.d.ts +0 -27
- package/dist/mlkit/MlkitCallMethod.js +0 -26
- package/dist/mlkit/mlkit.d.ts +0 -86
- package/dist/mlkit/mlkit.js +0 -169
- package/dist/network/http.d.ts +0 -127
- package/dist/network/http.js +0 -202
- /package/src/{AccessibilityEventFilter.ts → accessibility-event-filter.ts} +0 -0
- /package/src/{AppInfo.ts → app-info.ts} +0 -0
- /package/src/barutils/{BarUtilsCallMethod.ts → bar-utils-call-method.ts} +0 -0
- /package/src/{Bounds.ts → bounds.ts} +0 -0
- /package/src/{CallMethod.ts → call-method.ts} +0 -0
- /package/src/{CallResponse.ts → call-response.ts} +0 -0
- /package/src/{DeviceInfo.ts → device-info.ts} +0 -0
- /package/src/floatingwindow/{FloatCallMethod.ts → float-call-method.ts} +0 -0
- /package/src/mlkit/{MlkitCallMethod.ts → mlkit-call-method.ts} +0 -0
- /package/src/{NodeClassValue.ts → node-class-value.ts} +0 -0
- /package/src/{StepError.ts → step-error.ts} +0 -0
- /package/src/{StepStateStore.ts → step-state-store.ts} +0 -0
- /package/src/{Utils.ts → utils.ts} +0 -0
- /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.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "assistsx-js自动化开发SDK",
|
|
5
|
-
"main": "dist/index.
|
|
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.
|
|
16
|
-
|
|
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": "
|
|
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 "./
|
|
6
|
-
import { CallMethod } from "./
|
|
7
|
-
import { CallResponse } from "./
|
|
8
|
-
import { Bounds } from "./
|
|
9
|
-
import { generateUUID } from "./
|
|
10
|
-
import { AppInfo } from "./
|
|
11
|
-
import { DeviceInfo } from "./
|
|
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 "./
|
|
16
|
+
} from "./assistsx";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* 截图识别位置信息
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* AssistsX 类
|
|
3
3
|
* 提供与移动应用程序界面交互的工具类,包括节点查找、手势操作、屏幕操作等功能
|
|
4
4
|
*/
|
|
5
|
-
import { Node } from "./
|
|
6
|
-
import { CallMethod } from "./
|
|
7
|
-
import { CallResponse } from "./
|
|
8
|
-
import { Bounds } from "./
|
|
9
|
-
import { decodeBase64UTF8, generateUUID } from "./
|
|
10
|
-
import { AccessibilityEventFilter } from "
|
|
11
|
-
import { AppInfo } from "./
|
|
12
|
-
import { DeviceInfo } from "./
|
|
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 "../
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../
|
|
7
|
-
import { BarUtilsCallMethod } from "./
|
|
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 "../../
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../../
|
|
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 "../../
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../../
|
|
5
|
+
import { CallResponse } from "../../call-response";
|
|
6
|
+
import { decodeBase64UTF8, generateUUID } from "../../utils";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 文件信息接口定义
|
package/src/filesystem/path.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* 路径相关功能
|
|
3
3
|
* 提供文件系统路径相关的功能
|
|
4
4
|
*/
|
|
5
|
-
import { CallResponse } from "../
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../
|
|
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 "../
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../
|
|
7
|
-
import { FloatCallMethod } from "./
|
|
8
|
-
import type { WebFloatingWindowOptions } from "../
|
|
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
|
|
package/src/gallery/gallery.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* 系统相册相关功能
|
|
3
3
|
* 提供添加图片/视频到相册和从相册删除的功能
|
|
4
4
|
*/
|
|
5
|
-
import { CallResponse } from "../
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../
|
|
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 "./
|
|
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 "../
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../
|
|
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 "../
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../
|
|
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 "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./
|
|
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/
|
|
26
|
+
export * from "./mlkit/mlkit-call-method";
|
|
27
27
|
export * from "./barutils/bar-utils";
|
|
28
|
-
export * from "./barutils/
|
|
28
|
+
export * from "./barutils/bar-utils-call-method";
|
|
29
29
|
export * from "./floatingwindow/float";
|
|
30
|
-
export * from "./floatingwindow/
|
|
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];
|