assistsx-js 0.0.1340 → 0.0.1350

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.
@@ -309,7 +309,24 @@ export declare class AssistsX {
309
309
  }, { duration }?: {
310
310
  duration?: number;
311
311
  }): Promise<boolean>;
312
+ static longPressNodeByGestureAutoPaste(node: Node, text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration }?: {
313
+ matchedPackageName?: string;
314
+ matchedText?: string;
315
+ timeoutMillis?: number;
316
+ longPressDuration?: number;
317
+ }): Promise<boolean>;
318
+ static longPressGestureAutoPaste(point: {
319
+ x: number;
320
+ y: number;
321
+ }, text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration }?: {
322
+ matchedPackageName?: string;
323
+ matchedText?: string;
324
+ timeoutMillis?: number;
325
+ longPressDuration?: number;
326
+ }): Promise<boolean>;
312
327
  static getAppInfo(packageName: string): Promise<any>;
328
+ static getAndroidID(): Promise<any>;
329
+ static getMacAddress(): Promise<any>;
313
330
  /**
314
331
  * 获取屏幕尺寸
315
332
  * @returns 屏幕尺寸对象
package/dist/AssistsX.js CHANGED
@@ -436,10 +436,26 @@ export class AssistsX {
436
436
  const response = await this.asyncCall(CallMethod.performLinearGesture, { args: { startPoint, endPoint, duration } });
437
437
  return response.getDataOrDefault(false);
438
438
  }
439
+ static async longPressNodeByGestureAutoPaste(node, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }) {
440
+ const response = await this.asyncCall(CallMethod.longPressGestureAutoPaste, { node, args: { text, matchedPackageName, matchedText, timeoutMillis, longPressDuration } });
441
+ return response.getDataOrDefault(false);
442
+ }
443
+ static async longPressGestureAutoPaste(point, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }) {
444
+ const response = await this.asyncCall(CallMethod.longPressGestureAutoPaste, { args: { point, text, matchedPackageName, matchedText, timeoutMillis, longPressDuration } });
445
+ return response.getDataOrDefault(false);
446
+ }
439
447
  static async getAppInfo(packageName) {
440
448
  const response = await this.asyncCall(CallMethod.getAppInfo, { args: { packageName } });
441
449
  return response.getDataOrDefault({});
442
450
  }
451
+ static async getAndroidID() {
452
+ const response = this.call(CallMethod.getAndroidID);
453
+ return response.getDataOrDefault("");
454
+ }
455
+ static async getMacAddress() {
456
+ const response = await this.asyncCall(CallMethod.getMacAddress);
457
+ return response.getDataOrDefault({});
458
+ }
443
459
  /**
444
460
  * 获取屏幕尺寸
445
461
  * @returns 屏幕尺寸对象
@@ -36,6 +36,9 @@ export declare const CallMethod: {
36
36
  readonly clickNodeByGesture: "clickNodeByGesture";
37
37
  readonly doubleClickNodeByGesture: "doubleClickNodeByGesture";
38
38
  readonly performLinearGesture: "performLinearGesture";
39
+ readonly longPressGestureAutoPaste: "longPressGestureAutoPaste";
39
40
  readonly getAppInfo: "getAppInfo";
41
+ readonly getMacAddress: "getMacAddress";
42
+ readonly getAndroidID: "getAndroidID";
40
43
  };
41
44
  export type CallMethodType = typeof CallMethod[keyof typeof CallMethod];
@@ -37,5 +37,8 @@ export const CallMethod = {
37
37
  clickNodeByGesture: "clickNodeByGesture",
38
38
  doubleClickNodeByGesture: "doubleClickNodeByGesture",
39
39
  performLinearGesture: "performLinearGesture",
40
+ longPressGestureAutoPaste: "longPressGestureAutoPaste",
40
41
  getAppInfo: "getAppInfo",
42
+ getMacAddress: "getMacAddress",
43
+ getAndroidID: "getAndroidID",
41
44
  };
package/dist/Node.d.ts CHANGED
@@ -85,6 +85,12 @@ export declare class Node {
85
85
  clickDuration?: number;
86
86
  clickInterval?: number;
87
87
  }): Promise<boolean>;
88
+ longPressNodeByGestureAutoPaste(text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration }?: {
89
+ matchedPackageName?: string;
90
+ matchedText?: string;
91
+ timeoutMillis?: number;
92
+ longPressDuration?: number;
93
+ }): Promise<boolean>;
88
94
  /**
89
95
  * 在当前节点范围内通过标签查找节点
90
96
  * @param className 类名
package/dist/Node.js CHANGED
@@ -46,6 +46,12 @@ export class Node {
46
46
  Step.assert(this.stepId);
47
47
  return result;
48
48
  }
49
+ async longPressNodeByGestureAutoPaste(text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }) {
50
+ Step.assert(this.stepId);
51
+ const result = await AssistsX.longPressNodeByGestureAutoPaste(this, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration });
52
+ Step.assert(this.stepId);
53
+ return result;
54
+ }
49
55
  /**
50
56
  * 在当前节点范围内通过标签查找节点
51
57
  * @param className 类名
package/dist/Step.d.ts CHANGED
@@ -233,6 +233,15 @@ export declare class Step {
233
233
  * @returns 是否成功
234
234
  */
235
235
  clickByGesture(x: number, y: number, duration: number): Promise<boolean>;
236
+ longPressGestureAutoPaste(point: {
237
+ x: number;
238
+ y: number;
239
+ }, text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration }?: {
240
+ matchedPackageName?: string;
241
+ matchedText?: string;
242
+ timeoutMillis?: number;
243
+ longPressDuration?: number;
244
+ }): Promise<boolean>;
236
245
  getAppInfo(packageName: string): Promise<any>;
237
246
  performLinearGesture(startPoint: {
238
247
  x: number;
package/dist/Step.js CHANGED
@@ -355,6 +355,12 @@ export class Step {
355
355
  Step.assert(this.stepId);
356
356
  return result;
357
357
  }
358
+ async longPressGestureAutoPaste(point, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }) {
359
+ Step.assert(this.stepId);
360
+ const result = await AssistsX.longPressGestureAutoPaste(point, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration });
361
+ Step.assert(this.stepId);
362
+ return result;
363
+ }
358
364
  async getAppInfo(packageName) {
359
365
  Step.assert(this.stepId);
360
366
  const result = await AssistsX.getAppInfo(packageName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.1340",
3
+ "version": "0.0.1350",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/src/AssistsX.ts CHANGED
@@ -499,10 +499,37 @@ export class AssistsX {
499
499
  const response = await this.asyncCall(CallMethod.performLinearGesture, { args: { startPoint, endPoint, duration } });
500
500
  return response.getDataOrDefault(false);
501
501
  }
502
+ public static async longPressNodeByGestureAutoPaste(
503
+ node: Node, text: string,
504
+ { matchedPackageName, matchedText, timeoutMillis, longPressDuration }:
505
+ { matchedPackageName?: string, matchedText?: string, timeoutMillis?: number, longPressDuration?: number } =
506
+ { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }
507
+ ): Promise<boolean> {
508
+ const response = await this.asyncCall(CallMethod.longPressGestureAutoPaste, { node, args: { text, matchedPackageName, matchedText, timeoutMillis, longPressDuration } });
509
+ return response.getDataOrDefault(false);
510
+ }
511
+
512
+ public static async longPressGestureAutoPaste(
513
+ point: { x: number, y: number }, text: string,
514
+ { matchedPackageName, matchedText, timeoutMillis, longPressDuration }:
515
+ { matchedPackageName?: string, matchedText?: string, timeoutMillis?: number, longPressDuration?: number } =
516
+ { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }
517
+ ): Promise<boolean> {
518
+ const response = await this.asyncCall(CallMethod.longPressGestureAutoPaste, { args: { point, text, matchedPackageName, matchedText, timeoutMillis, longPressDuration } });
519
+ return response.getDataOrDefault(false);
520
+ }
502
521
  public static async getAppInfo(packageName: string): Promise<any> {
503
522
  const response = await this.asyncCall(CallMethod.getAppInfo, { args: { packageName } });
504
523
  return response.getDataOrDefault({});
505
524
  }
525
+ public static async getAndroidID(): Promise<any> {
526
+ const response = this.call(CallMethod.getAndroidID);
527
+ return response.getDataOrDefault("");
528
+ }
529
+ public static async getMacAddress(): Promise<any> {
530
+ const response = await this.asyncCall(CallMethod.getMacAddress);
531
+ return response.getDataOrDefault({});
532
+ }
506
533
 
507
534
  /**
508
535
  * 获取屏幕尺寸
package/src/CallMethod.ts CHANGED
@@ -38,8 +38,11 @@ export const CallMethod = {
38
38
  clickNodeByGesture: "clickNodeByGesture",
39
39
  doubleClickNodeByGesture: "doubleClickNodeByGesture",
40
40
  performLinearGesture: "performLinearGesture",
41
+ longPressGestureAutoPaste: "longPressGestureAutoPaste",
41
42
 
42
43
  getAppInfo: "getAppInfo",
44
+ getMacAddress: "getMacAddress",
45
+ getAndroidID: "getAndroidID",
43
46
  } as const;
44
47
 
45
48
  // 导出类型定义
package/src/Node.ts CHANGED
@@ -108,6 +108,18 @@ export class Node {
108
108
  Step.assert(this.stepId);
109
109
  return result;
110
110
  }
111
+
112
+ public async longPressNodeByGestureAutoPaste(text: string,
113
+ { matchedPackageName, matchedText, timeoutMillis, longPressDuration }:
114
+ { matchedPackageName?: string, matchedText?: string, timeoutMillis?: number, longPressDuration?: number } =
115
+ { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }
116
+ ): Promise<boolean> {
117
+ Step.assert(this.stepId);
118
+ const result = await AssistsX.longPressNodeByGestureAutoPaste(this, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration });
119
+ Step.assert(this.stepId);
120
+ return result;
121
+ }
122
+
111
123
  /**
112
124
  * 在当前节点范围内通过标签查找节点
113
125
  * @param className 类名
package/src/Step.ts CHANGED
@@ -410,6 +410,18 @@ export class Step {
410
410
  Step.assert(this.stepId);
411
411
  return result;
412
412
  }
413
+
414
+ public async longPressGestureAutoPaste(
415
+ point: { x: number, y: number }, text: string,
416
+ { matchedPackageName, matchedText, timeoutMillis, longPressDuration }:
417
+ { matchedPackageName?: string, matchedText?: string, timeoutMillis?: number, longPressDuration?: number } =
418
+ { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }
419
+ ): Promise<boolean> {
420
+ Step.assert(this.stepId);
421
+ const result = await AssistsX.longPressGestureAutoPaste(point, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration });
422
+ Step.assert(this.stepId);
423
+ return result;
424
+ }
413
425
  public async getAppInfo(packageName: string): Promise<any> {
414
426
  Step.assert(this.stepId);
415
427
  const result = await AssistsX.getAppInfo(packageName);