@qawolf/run-globals-android 1.0.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 (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -0
  3. package/dist/emulator/index.d.ts +5 -0
  4. package/dist/emulator/index.d.ts.map +1 -0
  5. package/dist/emulator/index.js +5 -0
  6. package/dist/emulator/index.js.map +1 -0
  7. package/dist/emulator/playAutomation.d.ts +33 -0
  8. package/dist/emulator/playAutomation.d.ts.map +1 -0
  9. package/dist/emulator/playAutomation.js +49 -0
  10. package/dist/emulator/playAutomation.js.map +1 -0
  11. package/dist/emulator/runCommand.d.ts +11 -0
  12. package/dist/emulator/runCommand.d.ts.map +1 -0
  13. package/dist/emulator/runCommand.js +45 -0
  14. package/dist/emulator/runCommand.js.map +1 -0
  15. package/dist/emulator/setGeoLocation.d.ts +32 -0
  16. package/dist/emulator/setGeoLocation.d.ts.map +1 -0
  17. package/dist/emulator/setGeoLocation.js +48 -0
  18. package/dist/emulator/setGeoLocation.js.map +1 -0
  19. package/dist/emulator/setProxy.d.ts +25 -0
  20. package/dist/emulator/setProxy.d.ts.map +1 -0
  21. package/dist/emulator/setProxy.js +34 -0
  22. package/dist/emulator/setProxy.js.map +1 -0
  23. package/dist/emulator/setVirtualSceneImage.d.ts +25 -0
  24. package/dist/emulator/setVirtualSceneImage.d.ts.map +1 -0
  25. package/dist/emulator/setVirtualSceneImage.js +35 -0
  26. package/dist/emulator/setVirtualSceneImage.js.map +1 -0
  27. package/dist/emulator/typings.d.ts +180 -0
  28. package/dist/emulator/uploadToEmulatorContainer.d.ts +2 -0
  29. package/dist/emulator/uploadToEmulatorContainer.d.ts.map +1 -0
  30. package/dist/emulator/uploadToEmulatorContainer.js +21 -0
  31. package/dist/emulator/uploadToEmulatorContainer.js.map +1 -0
  32. package/dist/index.d.ts +2 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +5 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/typings.d.ts +62 -0
  37. package/package.json +53 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QA Wolf Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # @qawolf/run-globals-android
2
+
3
+ `@qawolf/run-globals-android` is a companion package for `@qawolf/flows`. It
4
+ provides Android device and emulator helpers used by QA Wolf Android flows.
5
+
6
+ Most users should start with the
7
+ [`@qawolf/flows` documentation](https://docs.qawolf.com/qawolf/libraries/flows).
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install @qawolf/run-globals-android
13
+ ```
@@ -0,0 +1,5 @@
1
+ export { type PlayAutomationOptions, playAutomation, } from "./playAutomation.js";
2
+ export { type GeoLocationOptions, setGeoLocation } from "./setGeoLocation.js";
3
+ export { type ProxyOptions, clearProxy, setProxy } from "./setProxy.js";
4
+ export { type VirtualSceneImageOptions, setVirtualSceneImage, } from "./setVirtualSceneImage.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/emulator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,kBAAkB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,KAAK,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EACL,KAAK,wBAAwB,EAC7B,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { playAutomation, } from "./playAutomation.js";
2
+ export { setGeoLocation } from "./setGeoLocation.js";
3
+ export { clearProxy, setProxy } from "./setProxy.js";
4
+ export { setVirtualSceneImage, } from "./setVirtualSceneImage.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/emulator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA2B,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAqB,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAEL,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ import { type RunCommandOptions } from "./runCommand.js";
3
+ /**
4
+ * Options for playing back an automation macro.
5
+ */
6
+ declare const PlayAutomationOptions: z.ZodUnion<readonly [z.ZodObject<{
7
+ macro: z.ZodEnum<{
8
+ Reset_position: "Reset_position";
9
+ Track_horizontal_plane: "Track_horizontal_plane";
10
+ Track_vertical_plane: "Track_vertical_plane";
11
+ Walk_to_image_room: "Walk_to_image_room";
12
+ }>;
13
+ overrideMacroPath: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ file: z.ZodString;
16
+ }, z.core.$strip>]>;
17
+ export type PlayAutomationOptions = z.input<typeof PlayAutomationOptions>;
18
+ /**
19
+ * Plays back the automation macro from the given file. Can use a built-in macro or a custom file.
20
+ *
21
+ * Use with `setVirtualSceneImage` to set the virtual scene image.
22
+ *
23
+ * ```plaintext
24
+ * 'play <filename>': start playing back the macro from the given file.
25
+ * ```
26
+ *
27
+ * @param options the geo location options
28
+ * @param runCommandOptions optional options to pass to runCommand
29
+ * @throws if the command failed
30
+ */
31
+ export declare function playAutomation(options: PlayAutomationOptions, runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
32
+ export {};
33
+ //# sourceMappingURL=playAutomation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playAutomation.d.ts","sourceRoot":"","sources":["../../src/emulator/playAutomation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,iBAAiB,CAAC;AAErE;;GAEG;AACH,QAAA,MAAM,qBAAqB;;;;;;;;;;mBAgBzB,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,qBAAqB,EAC9B,iBAAiB,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAClD,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
@@ -0,0 +1,49 @@
1
+ import path from "path";
2
+ import { z } from "zod";
3
+ import { runCommand } from "./runCommand.js";
4
+ /**
5
+ * Options for playing back an automation macro.
6
+ */
7
+ const PlayAutomationOptions = z.union([
8
+ z.object({
9
+ /** Built-in macro to play */
10
+ macro: z.enum([
11
+ "Reset_position",
12
+ "Track_horizontal_plane",
13
+ "Track_vertical_plane",
14
+ "Walk_to_image_room",
15
+ ]),
16
+ /** Optional custom path to macros. Mostly for local development. */
17
+ overrideMacroPath: z.string().optional(),
18
+ }),
19
+ z.object({
20
+ /** Full file path to the macro to play */
21
+ file: z.string(),
22
+ }),
23
+ ]);
24
+ /**
25
+ * Plays back the automation macro from the given file. Can use a built-in macro or a custom file.
26
+ *
27
+ * Use with `setVirtualSceneImage` to set the virtual scene image.
28
+ *
29
+ * ```plaintext
30
+ * 'play <filename>': start playing back the macro from the given file.
31
+ * ```
32
+ *
33
+ * @param options the geo location options
34
+ * @param runCommandOptions optional options to pass to runCommand
35
+ * @throws if the command failed
36
+ */
37
+ export async function playAutomation(options, runCommandOptions) {
38
+ const parsedOptions = PlayAutomationOptions.parse(options);
39
+ const macroPath = ("overrideMacroPath" in parsedOptions && parsedOptions.overrideMacroPath) ||
40
+ "/opt/android/emulator/resources/macros";
41
+ const file = "macro" in parsedOptions
42
+ ? path.join(macroPath, parsedOptions.macro)
43
+ : parsedOptions.file;
44
+ return await runCommand("adb", {
45
+ args: ["emu", "automation", "play", file],
46
+ ...runCommandOptions,
47
+ });
48
+ }
49
+ //# sourceMappingURL=playAutomation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playAutomation.js","sourceRoot":"","sources":["../../src/emulator/playAutomation.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErE;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC;IACpC,CAAC,CAAC,MAAM,CAAC;QACP,6BAA6B;QAC7B,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC;YACZ,gBAAgB;YAChB,wBAAwB;YACxB,sBAAsB;YACtB,oBAAoB;SACrB,CAAC;QACF,oEAAoE;QACpE,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACzC,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,0CAA0C;QAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;CACH,CAAC,CAAC;AAIH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAA8B,EAC9B,iBAAmD;IAEnD,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE3D,MAAM,SAAS,GACb,CAAC,mBAAmB,IAAI,aAAa,IAAI,aAAa,CAAC,iBAAiB,CAAC;QACzE,wCAAwC,CAAC;IAE3C,MAAM,IAAI,GACR,OAAO,IAAI,aAAa;QACtB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC;QAC3C,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC;IAEzB,OAAO,MAAM,UAAU,CAAC,KAAK,EAAE;QAC7B,IAAI,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC;QACzC,GAAG,iBAAiB;KACrB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export declare const RunCommandOptions: z.ZodObject<{
3
+ amendPath: z.ZodOptional<z.ZodString>;
4
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
5
+ cwdRelativeToHome: z.ZodOptional<z.ZodString>;
6
+ logStderr: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.core.$ZodFunctionOut>>;
7
+ timeout: z.ZodOptional<z.ZodNumber>;
8
+ }, z.core.$strip>;
9
+ export type RunCommandOptions = z.input<typeof RunCommandOptions>;
10
+ export declare function runCommand(command: string, options?: RunCommandOptions): Promise<string>;
11
+ //# sourceMappingURL=runCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runCommand.d.ts","sourceRoot":"","sources":["../../src/emulator/runCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAuCjB"}
@@ -0,0 +1,45 @@
1
+ import { execa } from "execa";
2
+ import ms from "ms";
3
+ import path from "path";
4
+ import { z } from "zod";
5
+ export const RunCommandOptions = z.object({
6
+ amendPath: z.string().optional(),
7
+ args: z.array(z.string()).default([]),
8
+ cwdRelativeToHome: z.string().optional(),
9
+ logStderr: z.function({ input: [z.string()] }).optional(),
10
+ timeout: z.number().optional(),
11
+ });
12
+ export async function runCommand(command, options = {}) {
13
+ const homeDir = process.env["HOME"];
14
+ if (!homeDir)
15
+ throw Error("HOME environment variable is not set");
16
+ const envPath = process.env["PATH"];
17
+ if (!envPath)
18
+ throw Error("PATH environment variable is not set");
19
+ const parsedOptions = RunCommandOptions.parse(options);
20
+ const { all, signal } = await execa(command, parsedOptions.args, {
21
+ cwd: path.join(homeDir, parsedOptions.cwdRelativeToHome ?? ""),
22
+ // Do not expose most real environment variables; security risk.
23
+ // Passing through some that commands might need.
24
+ env: {
25
+ HOME: process.env["HOME"],
26
+ LANG: process.env["LANG"],
27
+ LANGUAGE: process.env["LANGUAGE"],
28
+ LC_ALL: process.env["LC_ALL"],
29
+ PATH: envPath +
30
+ (parsedOptions.amendPath ? `:${parsedOptions.amendPath}` : ""),
31
+ PULSE_SERVER: process.env["PULSE_SERVER"],
32
+ },
33
+ // Combine stdout and stderr
34
+ all: true,
35
+ // Prevent process.env from being passed to the command
36
+ extendEnv: false,
37
+ // Default to a sensible 1 minute timeout; user can override if necessary
38
+ timeout: parsedOptions.timeout ?? ms("1m"),
39
+ });
40
+ // We can't be totally sure, but SIGTERM usually means the command timed out
41
+ if (signal === "SIGTERM")
42
+ throw Error("Command timed out");
43
+ return all;
44
+ }
45
+ //# sourceMappingURL=runCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runCommand.js","sourceRoot":"","sources":["../../src/emulator/runCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,UAA6B,EAAE;IAE/B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO;QAAE,MAAM,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAElE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO;QAAE,MAAM,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAElE,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEvD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,EAAE;QAC/D,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,iBAAiB,IAAI,EAAE,CAAC;QAE9D,gEAAgE;QAChE,iDAAiD;QACjD,GAAG,EAAE;YACH,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;YACzB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;YACzB,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;YACjC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC7B,IAAI,EACF,OAAO;gBACP,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;SAC1C;QAED,4BAA4B;QAC5B,GAAG,EAAE,IAAI;QAET,uDAAuD;QACvD,SAAS,EAAE,KAAK;QAEhB,yEAAyE;QACzE,OAAO,EAAE,aAAa,CAAC,OAAO,IAAI,EAAE,CAAC,IAAI,CAAC;KAC3C,CAAC,CAAC;IAEH,4EAA4E;IAC5E,IAAI,MAAM,KAAK,SAAS;QAAE,MAAM,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAE3D,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { z } from "zod";
2
+ import { type RunCommandOptions } from "./runCommand.js";
3
+ declare const GeoLocationOptions: z.ZodObject<{
4
+ altitude: z.ZodDefault<z.ZodNumber>;
5
+ latitude: z.ZodNumber;
6
+ longitude: z.ZodNumber;
7
+ satellites: z.ZodDefault<z.ZodNumber>;
8
+ velocity: z.ZodDefault<z.ZodNumber>;
9
+ }, z.core.$strip>;
10
+ export type GeoLocationOptions = z.input<typeof GeoLocationOptions>;
11
+ /**
12
+ * Set the geo location of the emulator.
13
+ *
14
+ * ```plaintext
15
+ * 'geo fix <longitude> <latitude> [<altitude> [<satellites> [<velocity>]]]'
16
+ * allows you to send a simple GPS fix to the emulated system.
17
+ * The parameters are:
18
+ *
19
+ * <longitude> longitude, in decimal degrees
20
+ * <latitude> latitude, in decimal degrees
21
+ * <altitude> optional altitude in meters
22
+ * <satellites> number of satellites being tracked (1-12)
23
+ * <velocity> optional velocity in knots
24
+ * ```
25
+ *
26
+ * @param options the geo location options
27
+ * @param runCommandOptions optional options to pass to runCommand
28
+ * @throws if the command failed
29
+ */
30
+ export declare function setGeoLocation(options: GeoLocationOptions, runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
31
+ export {};
32
+ //# sourceMappingURL=setGeoLocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setGeoLocation.d.ts","sourceRoot":"","sources":["../../src/emulator/setGeoLocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,iBAAiB,CAAC;AAErE,QAAA,MAAM,kBAAkB;;;;;;iBAWtB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,kBAAkB,EAC3B,iBAAiB,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAClD,OAAO,CAAC,MAAM,CAAC,CAejB"}
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+ import { runCommand } from "./runCommand.js";
3
+ const GeoLocationOptions = z.object({
4
+ /** Optional altitude in meters. Defaults to 0. */
5
+ altitude: z.number().default(0),
6
+ /** Latitude in range [-90,+90]. */
7
+ latitude: z.number().min(-90).max(90),
8
+ /** Longitude in range [-180,+180]. */
9
+ longitude: z.number().min(-180).max(180),
10
+ /** Optional number of satellites being tracked (1-12). Defaults to 6. */
11
+ satellites: z.number().int().max(12).min(1).default(6),
12
+ /** Optional velocity in knots. Defaults to 0. */
13
+ velocity: z.number().default(0),
14
+ });
15
+ /**
16
+ * Set the geo location of the emulator.
17
+ *
18
+ * ```plaintext
19
+ * 'geo fix <longitude> <latitude> [<altitude> [<satellites> [<velocity>]]]'
20
+ * allows you to send a simple GPS fix to the emulated system.
21
+ * The parameters are:
22
+ *
23
+ * <longitude> longitude, in decimal degrees
24
+ * <latitude> latitude, in decimal degrees
25
+ * <altitude> optional altitude in meters
26
+ * <satellites> number of satellites being tracked (1-12)
27
+ * <velocity> optional velocity in knots
28
+ * ```
29
+ *
30
+ * @param options the geo location options
31
+ * @param runCommandOptions optional options to pass to runCommand
32
+ * @throws if the command failed
33
+ */
34
+ export async function setGeoLocation(options, runCommandOptions) {
35
+ const parsedOptions = GeoLocationOptions.parse(options);
36
+ const params = [
37
+ parsedOptions.longitude,
38
+ parsedOptions.latitude,
39
+ parsedOptions.altitude,
40
+ parsedOptions.satellites,
41
+ parsedOptions.velocity,
42
+ ].map((n) => String(n));
43
+ return await runCommand("adb", {
44
+ args: ["emu", "geo", "fix", ...params],
45
+ ...runCommandOptions,
46
+ });
47
+ }
48
+ //# sourceMappingURL=setGeoLocation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setGeoLocation.js","sourceRoot":"","sources":["../../src/emulator/setGeoLocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErE,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,kDAAkD;IAClD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/B,mCAAmC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACrC,sCAAsC;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACxC,yEAAyE;IACzE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,iDAAiD;IACjD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;CAChC,CAAC,CAAC;AAIH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAA2B,EAC3B,iBAAmD;IAEnD,MAAM,aAAa,GAAG,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAExD,MAAM,MAAM,GAAG;QACb,aAAa,CAAC,SAAS;QACvB,aAAa,CAAC,QAAQ;QACtB,aAAa,CAAC,QAAQ;QACtB,aAAa,CAAC,UAAU;QACxB,aAAa,CAAC,QAAQ;KACvB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAExB,OAAO,MAAM,UAAU,CAAC,KAAK,EAAE;QAC7B,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACtC,GAAG,iBAAiB;KACrB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ import { type RunCommandOptions } from "./runCommand.js";
3
+ declare const ProxyOptions: z.ZodObject<{
4
+ url: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type ProxyOptions = z.input<typeof ProxyOptions>;
7
+ /**
8
+ * Set the proxy for the emulator. If the proxy requires authentication,
9
+ * username and password must be provided in the URL.
10
+ * Example URL: http://username:password@proxy.example.com:8080
11
+ *
12
+ * @param options the proxy options
13
+ * @param runCommandOptions optional options to pass to runCommand
14
+ * @throws if the command failed
15
+ */
16
+ export declare function setProxy(options: ProxyOptions, runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
17
+ /**
18
+ * Clear the proxy setting for the emulator.
19
+ *
20
+ * @param runCommandOptions optional options to pass to runCommand
21
+ * @throws if the command failed
22
+ */
23
+ export declare function clearProxy(runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
24
+ export {};
25
+ //# sourceMappingURL=setProxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setProxy.d.ts","sourceRoot":"","sources":["../../src/emulator/setProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,iBAAiB,CAAC;AAErE,QAAA,MAAM,YAAY;;iBAEhB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,YAAY,EACrB,iBAAiB,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAClD,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,iBAAiB,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAClD,OAAO,CAAC,MAAM,CAAC,CAKjB"}
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ import { runCommand } from "./runCommand.js";
3
+ const ProxyOptions = z.object({
4
+ url: z.string(),
5
+ });
6
+ /**
7
+ * Set the proxy for the emulator. If the proxy requires authentication,
8
+ * username and password must be provided in the URL.
9
+ * Example URL: http://username:password@proxy.example.com:8080
10
+ *
11
+ * @param options the proxy options
12
+ * @param runCommandOptions optional options to pass to runCommand
13
+ * @throws if the command failed
14
+ */
15
+ export async function setProxy(options, runCommandOptions) {
16
+ const parsedOptions = ProxyOptions.parse(options);
17
+ return runCommand("adb", {
18
+ args: ["emu", "proxy", "set", parsedOptions.url],
19
+ ...runCommandOptions,
20
+ });
21
+ }
22
+ /**
23
+ * Clear the proxy setting for the emulator.
24
+ *
25
+ * @param runCommandOptions optional options to pass to runCommand
26
+ * @throws if the command failed
27
+ */
28
+ export async function clearProxy(runCommandOptions) {
29
+ return runCommand("adb", {
30
+ args: ["emu", "proxy", "clear"],
31
+ ...runCommandOptions,
32
+ });
33
+ }
34
+ //# sourceMappingURL=setProxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setProxy.js","sourceRoot":"","sources":["../../src/emulator/setProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErE,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC;AAIH;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,OAAqB,EACrB,iBAAmD;IAEnD,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO,UAAU,CAAC,KAAK,EAAE;QACvB,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC;QAChD,GAAG,iBAAiB;KACrB,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,iBAAmD;IAEnD,OAAO,UAAU,CAAC,KAAK,EAAE;QACvB,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC;QAC/B,GAAG,iBAAiB;KACrB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ import { type RunCommandOptions } from "./runCommand.js";
3
+ declare const VirtualSceneImageOptions: z.ZodObject<{
4
+ image: z.ZodDefault<z.ZodString>;
5
+ location: z.ZodEnum<{
6
+ wall: "wall";
7
+ table: "table";
8
+ }>;
9
+ }, z.core.$strip>;
10
+ export type VirtualSceneImageOptions = z.input<typeof VirtualSceneImageOptions>;
11
+ /**
12
+ * Set or reset the virtual scene image.
13
+ *
14
+ * ```plaintext
15
+ * Usage: virtualscene-image <wall|table> [path-to-image].
16
+ * If path-to-image is void, restore default image.
17
+ * ```
18
+ *
19
+ * @param options the virtual scene image options
20
+ * @param runCommandOptions optional options to pass to runCommand
21
+ * @throws if the command failed
22
+ */
23
+ export declare function setVirtualSceneImage(options: VirtualSceneImageOptions, runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
24
+ export {};
25
+ //# sourceMappingURL=setVirtualSceneImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setVirtualSceneImage.d.ts","sourceRoot":"","sources":["../../src/emulator/setVirtualSceneImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,iBAAiB,CAAC;AAGrE,QAAA,MAAM,wBAAwB;;;;;;iBAK5B,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,wBAAwB,EACjC,iBAAiB,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAClD,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ import { runCommand } from "./runCommand.js";
3
+ import { uploadToEmulatorContainer } from "./uploadToEmulatorContainer.js";
4
+ const VirtualSceneImageOptions = z.object({
5
+ /** Optional absolute path to image file. Leave empty to reset to default. */
6
+ image: z.string().default(""),
7
+ /** Virtual scene location to update the image. */
8
+ location: z.enum(["wall", "table"]),
9
+ });
10
+ /**
11
+ * Set or reset the virtual scene image.
12
+ *
13
+ * ```plaintext
14
+ * Usage: virtualscene-image <wall|table> [path-to-image].
15
+ * If path-to-image is void, restore default image.
16
+ * ```
17
+ *
18
+ * @param options the virtual scene image options
19
+ * @param runCommandOptions optional options to pass to runCommand
20
+ * @throws if the command failed
21
+ */
22
+ export async function setVirtualSceneImage(options, runCommandOptions) {
23
+ const parsedOptions = VirtualSceneImageOptions.parse(options);
24
+ let imagePath = parsedOptions.image;
25
+ // adb emu virtualscene-image requires the image to be in the emulator's file system.
26
+ // In local emulators, we use QAWOLF_ANDROID_EMULATOR_SHARED_DIR to share files.
27
+ // In remote emulators, we need to upload the image to the emulator container first.
28
+ console.log(`Uploading virtual scene image to the remote emulator: ${imagePath}`);
29
+ imagePath = await uploadToEmulatorContainer(parsedOptions.image);
30
+ return await runCommand("adb", {
31
+ args: ["emu", "virtualscene-image", parsedOptions.location, imagePath],
32
+ ...runCommandOptions,
33
+ });
34
+ }
35
+ //# sourceMappingURL=setVirtualSceneImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setVirtualSceneImage.js","sourceRoot":"","sources":["../../src/emulator/setVirtualSceneImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,6EAA6E;IAC7E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,kDAAkD;IAClD,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC,CAAC;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAiC,EACjC,iBAAmD;IAEnD,MAAM,aAAa,GAAG,wBAAwB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,IAAI,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC;IAEpC,qFAAqF;IACrF,gFAAgF;IAChF,oFAAoF;IACpF,OAAO,CAAC,GAAG,CACT,yDAAyD,SAAS,EAAE,CACrE,CAAC;IACF,SAAS,GAAG,MAAM,yBAAyB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAEjE,OAAO,MAAM,UAAU,CAAC,KAAK,EAAE;QAC7B,IAAI,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,aAAa,CAAC,QAAQ,EAAE,SAAS,CAAC;QACtE,GAAG,iBAAiB;KACrB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,180 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { z } from 'zod';
4
+
5
+ declare const RunCommandOptions: z.ZodObject<{
6
+ amendPath: z.ZodOptional<z.ZodString>;
7
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
8
+ cwdRelativeToHome: z.ZodOptional<z.ZodString>;
9
+ logStderr: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [
10
+ z.ZodString
11
+ ], null>, z.core.$ZodFunctionOut>>;
12
+ timeout: z.ZodOptional<z.ZodNumber>;
13
+ }, z.core.$strip>;
14
+ type RunCommandOptions = z.input<typeof RunCommandOptions>;
15
+ declare const PlayAutomationOptions: z.ZodUnion<readonly [
16
+ z.ZodObject<{
17
+ macro: z.ZodEnum<{
18
+ Reset_position: "Reset_position";
19
+ Track_horizontal_plane: "Track_horizontal_plane";
20
+ Track_vertical_plane: "Track_vertical_plane";
21
+ Walk_to_image_room: "Walk_to_image_room";
22
+ }>;
23
+ overrideMacroPath: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>,
25
+ z.ZodObject<{
26
+ file: z.ZodString;
27
+ }, z.core.$strip>
28
+ ]>;
29
+ type PlayAutomationOptions$1 = z.input<typeof PlayAutomationOptions>;
30
+ /**
31
+ * Plays back the automation macro from the given file. Can use a built-in macro or a custom file.
32
+ *
33
+ * Use with `setVirtualSceneImage` to set the virtual scene image.
34
+ *
35
+ * ```plaintext
36
+ * 'play <filename>': start playing back the macro from the given file.
37
+ * ```
38
+ *
39
+ * @param options the geo location options
40
+ * @param runCommandOptions optional options to pass to runCommand
41
+ * @throws if the command failed
42
+ */
43
+ export declare function playAutomation(options: PlayAutomationOptions$1, runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
44
+ declare const GeoLocationOptions: z.ZodObject<{
45
+ altitude: z.ZodDefault<z.ZodNumber>;
46
+ latitude: z.ZodNumber;
47
+ longitude: z.ZodNumber;
48
+ satellites: z.ZodDefault<z.ZodNumber>;
49
+ velocity: z.ZodDefault<z.ZodNumber>;
50
+ }, z.core.$strip>;
51
+ type GeoLocationOptions$1 = z.input<typeof GeoLocationOptions>;
52
+ /**
53
+ * Set the geo location of the emulator.
54
+ *
55
+ * ```plaintext
56
+ * 'geo fix <longitude> <latitude> [<altitude> [<satellites> [<velocity>]]]'
57
+ * allows you to send a simple GPS fix to the emulated system.
58
+ * The parameters are:
59
+ *
60
+ * <longitude> longitude, in decimal degrees
61
+ * <latitude> latitude, in decimal degrees
62
+ * <altitude> optional altitude in meters
63
+ * <satellites> number of satellites being tracked (1-12)
64
+ * <velocity> optional velocity in knots
65
+ * ```
66
+ *
67
+ * @param options the geo location options
68
+ * @param runCommandOptions optional options to pass to runCommand
69
+ * @throws if the command failed
70
+ */
71
+ export declare function setGeoLocation(options: GeoLocationOptions$1, runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
72
+ declare const ProxyOptions: z.ZodObject<{
73
+ url: z.ZodString;
74
+ }, z.core.$strip>;
75
+ type ProxyOptions$1 = z.input<typeof ProxyOptions>;
76
+ /**
77
+ * Set the proxy for the emulator. If the proxy requires authentication,
78
+ * username and password must be provided in the URL.
79
+ * Example URL: http://username:password@proxy.example.com:8080
80
+ *
81
+ * @param options the proxy options
82
+ * @param runCommandOptions optional options to pass to runCommand
83
+ * @throws if the command failed
84
+ */
85
+ export declare function setProxy(options: ProxyOptions$1, runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
86
+ /**
87
+ * Clear the proxy setting for the emulator.
88
+ *
89
+ * @param runCommandOptions optional options to pass to runCommand
90
+ * @throws if the command failed
91
+ */
92
+ export declare function clearProxy(runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
93
+ declare const VirtualSceneImageOptions: z.ZodObject<{
94
+ image: z.ZodDefault<z.ZodString>;
95
+ location: z.ZodEnum<{
96
+ wall: "wall";
97
+ table: "table";
98
+ }>;
99
+ }, z.core.$strip>;
100
+ type VirtualSceneImageOptions$1 = z.input<typeof VirtualSceneImageOptions>;
101
+ /**
102
+ * Set or reset the virtual scene image.
103
+ *
104
+ * ```plaintext
105
+ * Usage: virtualscene-image <wall|table> [path-to-image].
106
+ * If path-to-image is void, restore default image.
107
+ * ```
108
+ *
109
+ * @param options the virtual scene image options
110
+ * @param runCommandOptions optional options to pass to runCommand
111
+ * @throws if the command failed
112
+ */
113
+ export declare function setVirtualSceneImage(options: VirtualSceneImageOptions$1, runCommandOptions?: Omit<RunCommandOptions, "args">): Promise<string>;
114
+ declare module "enzyme-shallow-equal" {
115
+ export default function shallowEqual(objA: unknown, objB: unknown): boolean;
116
+ }
117
+ declare module "http-compression" {
118
+ import type { IncomingMessage, ServerResponse } from "node:http";
119
+ type Options = {
120
+ brotli?: boolean;
121
+ gzip?: boolean;
122
+ level?: number;
123
+ mimes?: RegExp;
124
+ threshold?: number;
125
+ };
126
+ type Handler = (req: IncomingMessage, res: ServerResponse) => void;
127
+ export default function compression(options?: Options): Handler;
128
+ }
129
+ declare module "parse-prometheus-text-format" {
130
+ export default function parsePrometheusTextFormat(text: string): {
131
+ metrics: {
132
+ value: string;
133
+ }[];
134
+ name: string;
135
+ }[];
136
+ }
137
+ declare module "react" {
138
+ namespace JSX {
139
+ // The entire namespace is deprecated in React, but VS Code doe not
140
+ // show the deprecation annotation on the namespace, so we add them
141
+ // on individual namespace members.
142
+ /**
143
+ * @deprecated Usually you want ReactNode from react instead. If you really think you need JSX.Element, explicitly import it from react.
144
+ */
145
+ interface Element extends JSX.Element {
146
+ // Prevent this from being an empty interface,
147
+ // which is then collapsed and does not pass
148
+ // the @deprecated annotation when using.
149
+ _dummy?: unknown;
150
+ }
151
+ }
152
+ }
153
+ type DefaultEventsMap = {
154
+ [event: string]: (...args: unknown[]) => void;
155
+ };
156
+ type EventsMap = {
157
+ [event: string]: unknown;
158
+ };
159
+ declare module "socket.io-client" {
160
+ interface Socket<ListenEvents extends EventsMap = DefaultEventsMap, EmitEvents extends EventsMap = ListenEvents> extends BaseSocket<ListenEvents, EmitEvents> {
161
+ timeout(ms: number): Socket<ListenEvents, EmitEvents> & {
162
+ /**
163
+ * disallow emit, since it is not correctly typed
164
+ * after this change.
165
+ *
166
+ * use emitWithAck instead.
167
+ */
168
+ emit: never;
169
+ };
170
+ }
171
+ }
172
+
173
+ export {
174
+ GeoLocationOptions$1 as GeoLocationOptions,
175
+ PlayAutomationOptions$1 as PlayAutomationOptions,
176
+ ProxyOptions$1 as ProxyOptions,
177
+ VirtualSceneImageOptions$1 as VirtualSceneImageOptions,
178
+ };
179
+
180
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function uploadToEmulatorContainer(filePath: string): Promise<string>;
2
+ //# sourceMappingURL=uploadToEmulatorContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadToEmulatorContainer.d.ts","sourceRoot":"","sources":["../../src/emulator/uploadToEmulatorContainer.ts"],"names":[],"mappings":"AAIA,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAsBjB"}
@@ -0,0 +1,21 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { z } from "zod";
4
+ export async function uploadToEmulatorContainer(filePath) {
5
+ const UploadResponseSchema = z.object({ path: z.string() });
6
+ const formData = new FormData();
7
+ formData.append("file", new Blob([
8
+ // Type cast because of @types/node 20 and TypeScript 5.9 incompatibility
9
+ (await fs.readFile(filePath)),
10
+ ]), path.basename(filePath));
11
+ // Accessing the gardener in the emulator container as localhost
12
+ // thanks to the tcp tunnel between the runner and the emulator container.
13
+ const response = await fetch(`http://localhost:7654/upload`, {
14
+ body: formData,
15
+ method: "POST",
16
+ });
17
+ if (!response.ok)
18
+ throw Error(`Failed to upload app: ${await response.text()}`);
19
+ return UploadResponseSchema.parse(await response.json()).path;
20
+ }
21
+ //# sourceMappingURL=uploadToEmulatorContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadToEmulatorContainer.js","sourceRoot":"","sources":["../../src/emulator/uploadToEmulatorContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,QAAgB;IAEhB,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAE5D,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,CACb,MAAM,EACN,IAAI,IAAI,CAAC;QACP,yEAAyE;QACzE,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAwB;KACrD,CAAC,EACF,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACxB,CAAC;IAEF,gEAAgE;IAChE,0EAA0E;IAC1E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,8BAA8B,EAAE;QAC3D,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM;KACf,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE;QACd,MAAM,KAAK,CAAC,yBAAyB,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAChE,OAAO,oBAAoB,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AAChE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ // Placeholder export. Needed to keep our generated types happy.
2
+ // This file can be used to add generic Android utilities.
3
+ // That is, ones that are supported in both the emulator and on real devices.
4
+ export {};
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,0DAA0D;AAC1D,6EAA6E;AAC7E,OAAO,EAAE,CAAC"}
@@ -0,0 +1,62 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ declare module "enzyme-shallow-equal" {
4
+ export default function shallowEqual(objA: unknown, objB: unknown): boolean;
5
+ }
6
+ declare module "http-compression" {
7
+ import type { IncomingMessage, ServerResponse } from "node:http";
8
+ type Options = {
9
+ brotli?: boolean;
10
+ gzip?: boolean;
11
+ level?: number;
12
+ mimes?: RegExp;
13
+ threshold?: number;
14
+ };
15
+ type Handler = (req: IncomingMessage, res: ServerResponse) => void;
16
+ export default function compression(options?: Options): Handler;
17
+ }
18
+ declare module "parse-prometheus-text-format" {
19
+ export default function parsePrometheusTextFormat(text: string): {
20
+ metrics: {
21
+ value: string;
22
+ }[];
23
+ name: string;
24
+ }[];
25
+ }
26
+ declare module "react" {
27
+ namespace JSX {
28
+ // The entire namespace is deprecated in React, but VS Code doe not
29
+ // show the deprecation annotation on the namespace, so we add them
30
+ // on individual namespace members.
31
+ /**
32
+ * @deprecated Usually you want ReactNode from react instead. If you really think you need JSX.Element, explicitly import it from react.
33
+ */
34
+ interface Element extends JSX.Element {
35
+ // Prevent this from being an empty interface,
36
+ // which is then collapsed and does not pass
37
+ // the @deprecated annotation when using.
38
+ _dummy?: unknown;
39
+ }
40
+ }
41
+ }
42
+ type DefaultEventsMap = {
43
+ [event: string]: (...args: unknown[]) => void;
44
+ };
45
+ type EventsMap = {
46
+ [event: string]: unknown;
47
+ };
48
+ declare module "socket.io-client" {
49
+ interface Socket<ListenEvents extends EventsMap = DefaultEventsMap, EmitEvents extends EventsMap = ListenEvents> extends BaseSocket<ListenEvents, EmitEvents> {
50
+ timeout(ms: number): Socket<ListenEvents, EmitEvents> & {
51
+ /**
52
+ * disallow emit, since it is not correctly typed
53
+ * after this change.
54
+ *
55
+ * use emitWithAck instead.
56
+ */
57
+ emit: never;
58
+ };
59
+ }
60
+ }
61
+
62
+ export {};
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@qawolf/run-globals-android",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "license": "MIT",
6
+ "sideEffects": false,
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./emulator": {
14
+ "types": "./dist/emulator/index.d.ts",
15
+ "import": "./dist/emulator/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "/dist",
20
+ "/LICENSE",
21
+ "/README.md"
22
+ ],
23
+ "scripts": {
24
+ "build": "rm -rf ./dist && tsc -p tsconfig.build.json && npm run build:dts",
25
+ "build:dts": "dts-bundle-generator --config dts.config.json",
26
+ "lint:ci": "npm run lint:non-fixable; NON_FIXABLE_EXIT=$?; npm run lint:fixable && exit $NON_FIXABLE_EXIT",
27
+ "lint:dev": "npm run lint:fixable",
28
+ "lint:fixable": "eslint . --ext cjs,cts,js,jsx,mjs,ts,tsx --fix --quiet && prettier --write .",
29
+ "lint:non-fixable": "dpdm --exit-code circular:1 --no-tree --no-warning --transform --include='.*' --exclude='/(dist|node_modules)/' '**/*'",
30
+ "prepublishOnly": "nx run run-globals-android:build",
31
+ "test": "NODE_OPTIONS=\"--experimental-vm-modules\" NODE_NO_WARNINGS=1 jest",
32
+ "test:watch": "npm run test -- --watch",
33
+ "tsc:check": "tsc"
34
+ },
35
+ "dependencies": {
36
+ "execa": "^9.3.1",
37
+ "ms": "^3.0.0-canary.202508261828",
38
+ "tslib": "^2.5.3",
39
+ "zod": "^4.1.11"
40
+ },
41
+ "devDependencies": {
42
+ "dts-bundle-generator": "^9.5.1",
43
+ "typescript": "^5.9.2"
44
+ },
45
+ "engines": {
46
+ "node": ">=22.22.0 <25"
47
+ },
48
+ "nx": {
49
+ "targets": {
50
+ "npm:publish": {}
51
+ }
52
+ }
53
+ }