@qapilot/appium-module 1.1.0 → 1.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 +1 -0
- package/dist/commands/command.registry.d.ts.map +1 -1
- package/dist/commands/command.registry.js +8 -2
- package/dist/commands/command.registry.js.map +1 -1
- package/dist/commands/element/element-info.d.ts +16 -0
- package/dist/commands/element/element-info.d.ts.map +1 -0
- package/dist/commands/element/element-info.js +27 -0
- package/dist/commands/element/element-info.js.map +1 -0
- package/dist/commands/element/find-element.command.d.ts.map +1 -1
- package/dist/commands/element/find-element.command.js +3 -1
- package/dist/commands/element/find-element.command.js.map +1 -1
- package/dist/commands/element/find-elements.command.d.ts.map +1 -1
- package/dist/commands/element/find-elements.command.js +7 -4
- package/dist/commands/element/find-elements.command.js.map +1 -1
- package/dist/commands/session/get-settings.command.d.ts +20 -0
- package/dist/commands/session/get-settings.command.d.ts.map +1 -0
- package/dist/commands/session/get-settings.command.js +21 -0
- package/dist/commands/session/get-settings.command.js.map +1 -0
- package/dist/commands/session/update-settings.command.d.ts +25 -0
- package/dist/commands/session/update-settings.command.d.ts.map +1 -0
- package/dist/commands/session/update-settings.command.js +33 -0
- package/dist/commands/session/update-settings.command.js.map +1 -0
- package/dist/commands/window/get-window-rect.command.d.ts +39 -0
- package/dist/commands/window/get-window-rect.command.d.ts.map +1 -0
- package/dist/commands/window/get-window-rect.command.js +45 -0
- package/dist/commands/window/get-window-rect.command.js.map +1 -0
- package/dist/types/webdriver.types.d.ts +12 -0
- package/dist/types/webdriver.types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -111,6 +111,7 @@ All commands are invoked via `invokeCommand({ commandName, provider, credentials
|
|
|
111
111
|
| | `getContexts` | `sessionId` |
|
|
112
112
|
| **Window** | `getWindow` | `sessionId` |
|
|
113
113
|
| | `getWindowHandles` | `sessionId` |
|
|
114
|
+
| | `getWindowRect` | `sessionId` |
|
|
114
115
|
| | `switchWindow` | `sessionId`, `handle` |
|
|
115
116
|
| **Device** | `hideKeyboard` | `sessionId` |
|
|
116
117
|
| | `isKeyboardShown` | `sessionId` |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.registry.d.ts","sourceRoot":"","sources":["../../src/commands/command.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"command.registry.d.ts","sourceRoot":"","sources":["../../src/commands/command.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAuDhD,KAAK,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;AA4D5D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAUnD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAEzD"}
|
|
@@ -3,6 +3,8 @@ import { AppiumError, AppiumErrorCode } from '../types/error.types.js';
|
|
|
3
3
|
import { CreateSessionCommand } from './session/create-session.command.js';
|
|
4
4
|
import { GetSessionCommand } from './session/get-session.command.js';
|
|
5
5
|
import { DeleteSessionCommand } from './session/delete-session.command.js';
|
|
6
|
+
import { GetSettingsCommand } from './session/get-settings.command.js';
|
|
7
|
+
import { UpdateSettingsCommand } from './session/update-settings.command.js';
|
|
6
8
|
// Element
|
|
7
9
|
import { FindElementCommand } from './element/find-element.command.js';
|
|
8
10
|
import { FindElementsCommand } from './element/find-elements.command.js';
|
|
@@ -28,6 +30,7 @@ import { GetContextsCommand } from './context/get-contexts.command.js';
|
|
|
28
30
|
// Window
|
|
29
31
|
import { GetWindowHandlesCommand } from './window/get-window-handles.command.js';
|
|
30
32
|
import { GetWindowCommand } from './window/get-window.command.js';
|
|
33
|
+
import { GetWindowRectCommand } from './window/get-window-rect.command.js';
|
|
31
34
|
import { SwitchWindowCommand } from './window/switch-window.command.js';
|
|
32
35
|
// Device
|
|
33
36
|
import { HideKeyboardCommand } from './device/hide-keyboard.command.js';
|
|
@@ -41,10 +44,12 @@ import { SetLocationCommand } from './device/set-location.command.js';
|
|
|
41
44
|
import { ExecuteScriptCommand } from './script/execute-script.command.js';
|
|
42
45
|
import { ExecuteScriptSyncCommand } from './script/execute-script-sync.command.js';
|
|
43
46
|
const commands = [
|
|
44
|
-
// Session (
|
|
47
|
+
// Session (5)
|
|
45
48
|
new CreateSessionCommand(),
|
|
46
49
|
new GetSessionCommand(),
|
|
47
50
|
new DeleteSessionCommand(),
|
|
51
|
+
new GetSettingsCommand(),
|
|
52
|
+
new UpdateSettingsCommand(),
|
|
48
53
|
// Element (11)
|
|
49
54
|
new FindElementCommand(),
|
|
50
55
|
new FindElementsCommand(),
|
|
@@ -67,9 +72,10 @@ const commands = [
|
|
|
67
72
|
new GetContextCommand(),
|
|
68
73
|
new SetContextCommand(),
|
|
69
74
|
new GetContextsCommand(),
|
|
70
|
-
// Window (
|
|
75
|
+
// Window (4)
|
|
71
76
|
new GetWindowHandlesCommand(),
|
|
72
77
|
new GetWindowCommand(),
|
|
78
|
+
new GetWindowRectCommand(),
|
|
73
79
|
new SwitchWindowCommand(),
|
|
74
80
|
// Device (7)
|
|
75
81
|
new HideKeyboardCommand(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.registry.js","sourceRoot":"","sources":["../../src/commands/command.registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAGvE,UAAU;AACV,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,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qB,IAAI,0BAA0B,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC7F,UAAU,EAAE,GAAG;SAChB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,OAAmB;IACjD,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collect everything a find response carried alongside the element id.
|
|
3
|
+
*
|
|
4
|
+
* Keys are passed through verbatim. The set of keys is whatever the session's
|
|
5
|
+
* `elementResponseAttributes` asked for, which differs between drivers
|
|
6
|
+
* (UiAutomator2 vs XCUITest) and even between driver versions, so this makes
|
|
7
|
+
* no attempt to normalize or interpret them. Notably `attribute/name` and
|
|
8
|
+
* `name` are distinct keys that would collide if the `attribute/` prefix were
|
|
9
|
+
* stripped.
|
|
10
|
+
*
|
|
11
|
+
* Returns undefined rather than {} when nothing came back, so callers can
|
|
12
|
+
* distinguish "no attributes requested / driver ignored the request" from
|
|
13
|
+
* "attributes returned but all empty".
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractElementInfo(value: Record<string, unknown> | null | undefined): Record<string, unknown> | undefined;
|
|
16
|
+
//# sourceMappingURL=element-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-info.d.ts","sourceRoot":"","sources":["../../../src/commands/element/element-info.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAOrC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { W3C_ELEMENT_KEY, LEGACY_ELEMENT_KEY } from '../../types/webdriver.types.js';
|
|
2
|
+
const ID_KEYS = new Set([W3C_ELEMENT_KEY, LEGACY_ELEMENT_KEY]);
|
|
3
|
+
/**
|
|
4
|
+
* Collect everything a find response carried alongside the element id.
|
|
5
|
+
*
|
|
6
|
+
* Keys are passed through verbatim. The set of keys is whatever the session's
|
|
7
|
+
* `elementResponseAttributes` asked for, which differs between drivers
|
|
8
|
+
* (UiAutomator2 vs XCUITest) and even between driver versions, so this makes
|
|
9
|
+
* no attempt to normalize or interpret them. Notably `attribute/name` and
|
|
10
|
+
* `name` are distinct keys that would collide if the `attribute/` prefix were
|
|
11
|
+
* stripped.
|
|
12
|
+
*
|
|
13
|
+
* Returns undefined rather than {} when nothing came back, so callers can
|
|
14
|
+
* distinguish "no attributes requested / driver ignored the request" from
|
|
15
|
+
* "attributes returned but all empty".
|
|
16
|
+
*/
|
|
17
|
+
export function extractElementInfo(value) {
|
|
18
|
+
if (value == null)
|
|
19
|
+
return undefined;
|
|
20
|
+
const info = {};
|
|
21
|
+
for (const [key, v] of Object.entries(value)) {
|
|
22
|
+
if (!ID_KEYS.has(key))
|
|
23
|
+
info[key] = v;
|
|
24
|
+
}
|
|
25
|
+
return Object.keys(info).length > 0 ? info : undefined;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=element-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-info.js","sourceRoot":"","sources":["../../../src/commands/element/element-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAErF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAiD;IAEjD,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC;IACpC,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-element.command.d.ts","sourceRoot":"","sources":["../../../src/commands/element/find-element.command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"find-element.command.d.ts","sourceRoot":"","sources":["../../../src/commands/element/find-element.command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,UAAU,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,kBAAmB,SAAQ,WAAW,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;IACtF,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAU;IAClC,QAAQ,CAAC,YAAY,kCAAkC;IAE9C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAiBlD,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO;IAI7C,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB;CAU9C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AppiumError, AppiumErrorCode } from '../../types/error.types.js';
|
|
2
2
|
import { W3C_ELEMENT_KEY, LEGACY_ELEMENT_KEY } from '../../types/webdriver.types.js';
|
|
3
3
|
import { BaseCommand } from '../base.command.js';
|
|
4
|
+
import { extractElementInfo } from './element-info.js';
|
|
4
5
|
export class FindElementCommand extends BaseCommand {
|
|
5
6
|
name = 'findElement';
|
|
6
7
|
method = 'POST';
|
|
@@ -30,7 +31,8 @@ export class FindElementCommand extends BaseCommand {
|
|
|
30
31
|
const elementId = value[W3C_ELEMENT_KEY] ??
|
|
31
32
|
value[LEGACY_ELEMENT_KEY] ??
|
|
32
33
|
'';
|
|
33
|
-
|
|
34
|
+
const elementInfo = extractElementInfo(value);
|
|
35
|
+
return elementInfo === undefined ? { elementId } : { elementId, elementInfo };
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
//# sourceMappingURL=find-element.command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-element.command.js","sourceRoot":"","sources":["../../../src/commands/element/find-element.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"find-element.command.js","sourceRoot":"","sources":["../../../src/commands/element/find-element.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAQvD,MAAM,OAAO,kBAAmB,SAAQ,WAAgD;IAC7E,IAAI,GAAG,aAAa,CAAC;IACrB,MAAM,GAAG,MAAe,CAAC;IACzB,YAAY,GAAG,8BAA8B,CAAC;IAE9C,QAAQ,CAAC,MAAyB;QACzC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,IAAI,WAAW,CAAC;gBACpB,IAAI,EAAE,eAAe,CAAC,gBAAgB;gBACtC,OAAO,EAAE,yCAAyC;gBAClD,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;QACL,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxD,MAAM,IAAI,WAAW,CAAC;gBACpB,IAAI,EAAE,eAAe,CAAC,gBAAgB;gBACtC,OAAO,EAAE,sCAAsC;gBAC/C,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,SAAS,CAAC,MAAyB;QACjC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACtD,CAAC;IAED,aAAa,CAAC,GAAY;QACxB,MAAM,IAAI,GAAG,GAA8B,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAA4B,CAAC;QACvD,MAAM,SAAS,GACZ,KAAK,CAAC,eAAe,CAAwB;YAC7C,KAAK,CAAC,kBAAkB,CAAwB;YACjD,EAAE,CAAC;QACL,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;IAChF,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-elements.command.d.ts","sourceRoot":"","sources":["../../../src/commands/element/find-elements.command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"find-elements.command.d.ts","sourceRoot":"","sources":["../../../src/commands/element/find-elements.command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,UAAU,kBAAmB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,mBAAoB,SAAQ,WAAW,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,CAAC;IAC1F,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAU;IAClC,QAAQ,CAAC,YAAY,mCAAmC;IAE/C,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAiBnD,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO;IAI9C,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,EAAE;CAahD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AppiumError, AppiumErrorCode } from '../../types/error.types.js';
|
|
2
2
|
import { W3C_ELEMENT_KEY, LEGACY_ELEMENT_KEY } from '../../types/webdriver.types.js';
|
|
3
3
|
import { BaseCommand } from '../base.command.js';
|
|
4
|
+
import { extractElementInfo } from './element-info.js';
|
|
4
5
|
export class FindElementsCommand extends BaseCommand {
|
|
5
6
|
name = 'findElements';
|
|
6
7
|
method = 'POST';
|
|
@@ -29,11 +30,13 @@ export class FindElementsCommand extends BaseCommand {
|
|
|
29
30
|
const value = body['value'];
|
|
30
31
|
if (!Array.isArray(value))
|
|
31
32
|
return [];
|
|
32
|
-
return value.map((el) =>
|
|
33
|
-
elementId
|
|
33
|
+
return value.map((el) => {
|
|
34
|
+
const elementId = el[W3C_ELEMENT_KEY] ??
|
|
34
35
|
el[LEGACY_ELEMENT_KEY] ??
|
|
35
|
-
''
|
|
36
|
-
|
|
36
|
+
'';
|
|
37
|
+
const elementInfo = extractElementInfo(el);
|
|
38
|
+
return elementInfo === undefined ? { elementId } : { elementId, elementInfo };
|
|
39
|
+
});
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
//# sourceMappingURL=find-elements.command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-elements.command.js","sourceRoot":"","sources":["../../../src/commands/element/find-elements.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"find-elements.command.js","sourceRoot":"","sources":["../../../src/commands/element/find-elements.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE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AC9C,EAAE,CAAC;YACL,MAAM,WAAW,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAAC;YAC3C,OAAO,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;QAChF,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../base.command.js';
|
|
2
|
+
interface GetSettingsParams extends Record<string, unknown> {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Read the driver settings currently in effect on a session.
|
|
7
|
+
*
|
|
8
|
+
* Returns the whole settings object as the driver reports it. Use this to
|
|
9
|
+
* capture values before `updateSettings` so they can be restored afterwards,
|
|
10
|
+
* which matters when the session is owned by someone else.
|
|
11
|
+
*/
|
|
12
|
+
export declare class GetSettingsCommand extends BaseCommand<GetSettingsParams, Record<string, unknown>> {
|
|
13
|
+
readonly name = "getSettings";
|
|
14
|
+
readonly method: "GET";
|
|
15
|
+
readonly pathTemplate = "/session/{sessionId}/appium/settings";
|
|
16
|
+
buildBody(_params: GetSettingsParams): undefined;
|
|
17
|
+
parseResponse(raw: unknown): Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=get-settings.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-settings.command.d.ts","sourceRoot":"","sources":["../../../src/commands/session/get-settings.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,UAAU,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,WAAW,CACjD,iBAAiB,EACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CACxB;IACC,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,MAAM,EAAG,KAAK,CAAU;IACjC,QAAQ,CAAC,YAAY,0CAA0C;IAE/D,SAAS,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS;IAIhD,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAIrD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseCommand } from '../base.command.js';
|
|
2
|
+
/**
|
|
3
|
+
* Read the driver settings currently in effect on a session.
|
|
4
|
+
*
|
|
5
|
+
* Returns the whole settings object as the driver reports it. Use this to
|
|
6
|
+
* capture values before `updateSettings` so they can be restored afterwards,
|
|
7
|
+
* which matters when the session is owned by someone else.
|
|
8
|
+
*/
|
|
9
|
+
export class GetSettingsCommand extends BaseCommand {
|
|
10
|
+
name = 'getSettings';
|
|
11
|
+
method = 'GET';
|
|
12
|
+
pathTemplate = '/session/{sessionId}/appium/settings';
|
|
13
|
+
buildBody(_params) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
parseResponse(raw) {
|
|
17
|
+
const body = raw;
|
|
18
|
+
return body['value'] ?? {};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=get-settings.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-settings.command.js","sourceRoot":"","sources":["../../../src/commands/session/get-settings.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD;;;;;;GAMG;AACH,MAAM,OAAO,kBAAmB,SAAQ,WAGvC;IACU,IAAI,GAAG,aAAa,CAAC;IACrB,MAAM,GAAG,KAAc,CAAC;IACxB,YAAY,GAAG,sCAAsC,CAAC;IAE/D,SAAS,CAAC,OAA0B;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,aAAa,CAAC,GAAY;QACxB,MAAM,IAAI,GAAG,GAA8B,CAAC;QAC5C,OAAQ,IAAI,CAAC,OAAO,CAAyC,IAAI,EAAE,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseCommand } from '../base.command.js';
|
|
2
|
+
interface UpdateSettingsParams extends Record<string, unknown> {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
settings: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Update Appium driver settings on a live session.
|
|
8
|
+
*
|
|
9
|
+
* The update is a partial merge — keys not supplied are left untouched — so
|
|
10
|
+
* callers can flip one setting without having to replay the whole object.
|
|
11
|
+
*
|
|
12
|
+
* Note that a driver accepts and stores settings it does not support, then
|
|
13
|
+
* ignores them, answering 200 either way. `getSettings` plus an observation of
|
|
14
|
+
* the actual behaviour is the only way to confirm a setting took effect.
|
|
15
|
+
*/
|
|
16
|
+
export declare class UpdateSettingsCommand extends BaseCommand<UpdateSettingsParams, void> {
|
|
17
|
+
readonly name = "updateSettings";
|
|
18
|
+
readonly method: "POST";
|
|
19
|
+
readonly pathTemplate = "/session/{sessionId}/appium/settings";
|
|
20
|
+
validate(params: UpdateSettingsParams): void;
|
|
21
|
+
buildBody(params: UpdateSettingsParams): unknown;
|
|
22
|
+
parseResponse(): void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=update-settings.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-settings.command.d.ts","sourceRoot":"","sources":["../../../src/commands/session/update-settings.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,UAAU,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;;;;GASG;AACH,qBAAa,qBAAsB,SAAQ,WAAW,CAAC,oBAAoB,EAAE,IAAI,CAAC;IAChF,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAU;IAClC,QAAQ,CAAC,YAAY,0CAA0C;IAEtD,QAAQ,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAUrD,SAAS,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO;IAIhD,aAAa,IAAI,IAAI;CAGtB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AppiumError, AppiumErrorCode } from '../../types/error.types.js';
|
|
2
|
+
import { BaseCommand } from '../base.command.js';
|
|
3
|
+
/**
|
|
4
|
+
* Update Appium driver settings on a live session.
|
|
5
|
+
*
|
|
6
|
+
* The update is a partial merge — keys not supplied are left untouched — so
|
|
7
|
+
* callers can flip one setting without having to replay the whole object.
|
|
8
|
+
*
|
|
9
|
+
* Note that a driver accepts and stores settings it does not support, then
|
|
10
|
+
* ignores them, answering 200 either way. `getSettings` plus an observation of
|
|
11
|
+
* the actual behaviour is the only way to confirm a setting took effect.
|
|
12
|
+
*/
|
|
13
|
+
export class UpdateSettingsCommand extends BaseCommand {
|
|
14
|
+
name = 'updateSettings';
|
|
15
|
+
method = 'POST';
|
|
16
|
+
pathTemplate = '/session/{sessionId}/appium/settings';
|
|
17
|
+
validate(params) {
|
|
18
|
+
if (params.settings === null || typeof params.settings !== 'object') {
|
|
19
|
+
throw new AppiumError({
|
|
20
|
+
code: AppiumErrorCode.VALIDATION_ERROR,
|
|
21
|
+
message: '"settings" is required and must be an object',
|
|
22
|
+
httpStatus: 400,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
buildBody(params) {
|
|
27
|
+
return { settings: params.settings };
|
|
28
|
+
}
|
|
29
|
+
parseResponse() {
|
|
30
|
+
// Appium answers {"value": null} — there is nothing to parse.
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=update-settings.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-settings.command.js","sourceRoot":"","sources":["../../../src/commands/session/update-settings.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOjD;;;;;;;;;GASG;AACH,MAAM,OAAO,qBAAsB,SAAQ,WAAuC;IACvE,IAAI,GAAG,gBAAgB,CAAC;IACxB,MAAM,GAAG,MAAe,CAAC;IACzB,YAAY,GAAG,sCAAsC,CAAC;IAEtD,QAAQ,CAAC,MAA4B;QAC5C,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACpE,MAAM,IAAI,WAAW,CAAC;gBACpB,IAAI,EAAE,eAAe,CAAC,gBAAgB;gBACtC,OAAO,EAAE,8CAA8C;gBACvD,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,SAAS,CAAC,MAA4B;QACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,aAAa;QACX,8DAA8D;IAChE,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { WebDriverRect } from '../../types/webdriver.types.js';
|
|
2
|
+
import { BaseCommand } from '../base.command.js';
|
|
3
|
+
interface GetWindowRectParams extends Record<string, unknown> {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* W3C `GET /session/{sessionId}/window/rect` — the size of the window under
|
|
8
|
+
* automation. This is what WebdriverIO's `client.getWindowSize()` calls.
|
|
9
|
+
*
|
|
10
|
+
* Distinct from the other window commands: `getWindow` returns the window
|
|
11
|
+
* HANDLE (an opaque string), not its geometry. There was previously no way
|
|
12
|
+
* to ask this module for screen dimensions at all.
|
|
13
|
+
*
|
|
14
|
+
* Why it matters: any gesture expressed as a fraction of the screen
|
|
15
|
+
* (swipe 25% of the height, tap at the horizontal centre) needs the same
|
|
16
|
+
* dimensions the rest of the toolchain uses, and the alternatives disagree
|
|
17
|
+
* on a real device. Measured on a Samsung A33 / Android 15, 1080x2400:
|
|
18
|
+
*
|
|
19
|
+
* GET /window/rect 1080x2400 full window
|
|
20
|
+
* mobile: viewportRect 1080x2335 excludes the 65px status bar
|
|
21
|
+
* mobile: deviceInfo no dimensions in the response at all
|
|
22
|
+
*
|
|
23
|
+
* Callers that computed geometry from `mobile: deviceInfo` were silently
|
|
24
|
+
* falling back to hardcoded defaults, because its response carries no
|
|
25
|
+
* display size on UiAutomator2.
|
|
26
|
+
*
|
|
27
|
+
* Note for iOS/XCUITest: this endpoint reports POINTS, not pixels, so on a
|
|
28
|
+
* Retina device the numbers are the logical size and will not match a
|
|
29
|
+
* screenshot's pixel dimensions. Android/UiAutomator2 reports pixels.
|
|
30
|
+
*/
|
|
31
|
+
export declare class GetWindowRectCommand extends BaseCommand<GetWindowRectParams, WebDriverRect> {
|
|
32
|
+
readonly name = "getWindowRect";
|
|
33
|
+
readonly method: "GET";
|
|
34
|
+
readonly pathTemplate = "/session/{sessionId}/window/rect";
|
|
35
|
+
buildBody(_params: GetWindowRectParams): undefined;
|
|
36
|
+
parseResponse(raw: unknown): WebDriverRect;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=get-window-rect.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-window-rect.command.d.ts","sourceRoot":"","sources":["../../../src/commands/window/get-window-rect.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,UAAU,mBAAoB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,oBAAqB,SAAQ,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC;IACvF,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,MAAM,EAAG,KAAK,CAAU;IACjC,QAAQ,CAAC,YAAY,sCAAsC;IAE3D,SAAS,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS;IAIlD,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa;CAU3C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseCommand } from '../base.command.js';
|
|
2
|
+
/**
|
|
3
|
+
* W3C `GET /session/{sessionId}/window/rect` — the size of the window under
|
|
4
|
+
* automation. This is what WebdriverIO's `client.getWindowSize()` calls.
|
|
5
|
+
*
|
|
6
|
+
* Distinct from the other window commands: `getWindow` returns the window
|
|
7
|
+
* HANDLE (an opaque string), not its geometry. There was previously no way
|
|
8
|
+
* to ask this module for screen dimensions at all.
|
|
9
|
+
*
|
|
10
|
+
* Why it matters: any gesture expressed as a fraction of the screen
|
|
11
|
+
* (swipe 25% of the height, tap at the horizontal centre) needs the same
|
|
12
|
+
* dimensions the rest of the toolchain uses, and the alternatives disagree
|
|
13
|
+
* on a real device. Measured on a Samsung A33 / Android 15, 1080x2400:
|
|
14
|
+
*
|
|
15
|
+
* GET /window/rect 1080x2400 full window
|
|
16
|
+
* mobile: viewportRect 1080x2335 excludes the 65px status bar
|
|
17
|
+
* mobile: deviceInfo no dimensions in the response at all
|
|
18
|
+
*
|
|
19
|
+
* Callers that computed geometry from `mobile: deviceInfo` were silently
|
|
20
|
+
* falling back to hardcoded defaults, because its response carries no
|
|
21
|
+
* display size on UiAutomator2.
|
|
22
|
+
*
|
|
23
|
+
* Note for iOS/XCUITest: this endpoint reports POINTS, not pixels, so on a
|
|
24
|
+
* Retina device the numbers are the logical size and will not match a
|
|
25
|
+
* screenshot's pixel dimensions. Android/UiAutomator2 reports pixels.
|
|
26
|
+
*/
|
|
27
|
+
export class GetWindowRectCommand extends BaseCommand {
|
|
28
|
+
name = 'getWindowRect';
|
|
29
|
+
method = 'GET';
|
|
30
|
+
pathTemplate = '/session/{sessionId}/window/rect';
|
|
31
|
+
buildBody(_params) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
parseResponse(raw) {
|
|
35
|
+
const body = raw;
|
|
36
|
+
const value = body['value'];
|
|
37
|
+
return {
|
|
38
|
+
x: Number(value['x'] ?? 0),
|
|
39
|
+
y: Number(value['y'] ?? 0),
|
|
40
|
+
width: Number(value['width'] ?? 0),
|
|
41
|
+
height: Number(value['height'] ?? 0),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=get-window-rect.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-window-rect.command.js","sourceRoot":"","sources":["../../../src/commands/window/get-window-rect.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAA+C;IAC9E,IAAI,GAAG,eAAe,CAAC;IACvB,MAAM,GAAG,KAAc,CAAC;IACxB,YAAY,GAAG,kCAAkC,CAAC;IAE3D,SAAS,CAAC,OAA4B;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,aAAa,CAAC,GAAY;QACxB,MAAM,IAAI,GAAG,GAA8B,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAA4B,CAAC;QACvD,OAAO;YACL,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC1B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAClC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACrC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -2,6 +2,18 @@ export declare const W3C_ELEMENT_KEY = "element-6066-11e4-a52e-4f735466cecf";
|
|
|
2
2
|
export declare const LEGACY_ELEMENT_KEY = "ELEMENT";
|
|
3
3
|
export interface WebDriverElement {
|
|
4
4
|
elementId: string;
|
|
5
|
+
/**
|
|
6
|
+
* Everything the find response carried alongside the element id, keys
|
|
7
|
+
* verbatim as the server sent them (`attribute/resource-id`, `rect`,
|
|
8
|
+
* `name`, `text`, ...).
|
|
9
|
+
*
|
|
10
|
+
* Absent unless the session has `shouldUseCompactResponses: false` and a
|
|
11
|
+
* non-empty `elementResponseAttributes`, which is NOT the driver default —
|
|
12
|
+
* see `updateSettings`. Also absent per-key: a driver silently omits any
|
|
13
|
+
* attribute name it does not serve, so treat a missing key as unknown
|
|
14
|
+
* rather than as an empty value.
|
|
15
|
+
*/
|
|
16
|
+
elementInfo?: Record<string, unknown>;
|
|
5
17
|
}
|
|
6
18
|
export interface WebDriverRect {
|
|
7
19
|
x: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webdriver.types.d.ts","sourceRoot":"","sources":["../../src/types/webdriver.types.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,wCAAwC,CAAC;AACrE,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"webdriver.types.d.ts","sourceRoot":"","sources":["../../src/types/webdriver.types.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,wCA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IACxB,IAAI,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,EAAE,gBAAgB,EAAE,GAAG,YAAY,EAAE,CAAC;CAC9C;AAGD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAGD,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,IAAI,GACJ,kBAAkB,GAClB,sBAAsB,GACtB,sBAAsB,GACtB,uBAAuB,GACvB,kBAAkB,GAClB,YAAY,GACZ,cAAc,GACd,MAAM,GACN,UAAU,GACV,WAAW,GACX,mBAAmB,CAAC;AAGxB,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AAGnD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qapilot/appium-module",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Appium W3C WebDriver module for interacting with devices across BrowserStack, LambdaTest, and local Appium servers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dev": "tsx watch src/server.ts",
|
|
25
25
|
"build": "tsc",
|
|
26
26
|
"start": "node dist/server.js",
|
|
27
|
-
"test": "tsx scripts/release-test/src/runner.ts",
|
|
28
27
|
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test": "tsx scripts/release-test/src/runner.ts",
|
|
29
29
|
"prepublishOnly": "npm run build"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|