appium-remote-debugger 15.9.1 → 15.10.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 (85) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/lib/mixins/connect.js +4 -4
  3. package/build/lib/mixins/connect.js.map +1 -1
  4. package/build/lib/mixins/execute.d.ts.map +1 -1
  5. package/build/lib/mixins/execute.js +2 -2
  6. package/build/lib/mixins/execute.js.map +1 -1
  7. package/build/lib/mixins/message-handlers.d.ts.map +1 -1
  8. package/build/lib/mixins/message-handlers.js +3 -2
  9. package/build/lib/mixins/message-handlers.js.map +1 -1
  10. package/build/lib/mixins/misc.d.ts +2 -1
  11. package/build/lib/mixins/misc.d.ts.map +1 -1
  12. package/build/lib/mixins/misc.js +5 -4
  13. package/build/lib/mixins/misc.js.map +1 -1
  14. package/build/lib/mixins/navigate.d.ts.map +1 -1
  15. package/build/lib/mixins/navigate.js +3 -2
  16. package/build/lib/mixins/navigate.js.map +1 -1
  17. package/build/lib/remote-debugger-real-device.js.map +1 -1
  18. package/build/lib/remote-debugger.d.ts.map +1 -1
  19. package/build/lib/remote-debugger.js +5 -7
  20. package/build/lib/remote-debugger.js.map +1 -1
  21. package/build/lib/rpc/rpc-client-real-device-shim.js +3 -3
  22. package/build/lib/rpc/rpc-client-real-device-shim.js.map +1 -1
  23. package/build/lib/rpc/rpc-client.d.ts.map +1 -1
  24. package/build/lib/rpc/rpc-client.js +16 -16
  25. package/build/lib/rpc/rpc-client.js.map +1 -1
  26. package/build/lib/rpc/rpc-message-handler.d.ts.map +1 -1
  27. package/build/lib/rpc/rpc-message-handler.js +3 -4
  28. package/build/lib/rpc/rpc-message-handler.js.map +1 -1
  29. package/build/lib/utils/async.d.ts +11 -0
  30. package/build/lib/utils/async.d.ts.map +1 -0
  31. package/build/lib/utils/async.js +28 -0
  32. package/build/lib/utils/async.js.map +1 -0
  33. package/build/lib/utils/errors.d.ts +13 -0
  34. package/build/lib/utils/errors.d.ts.map +1 -0
  35. package/build/lib/utils/errors.js +24 -0
  36. package/build/lib/utils/errors.js.map +1 -0
  37. package/build/lib/utils/index.d.ts +9 -0
  38. package/build/lib/utils/index.d.ts.map +1 -0
  39. package/build/lib/utils/index.js +27 -0
  40. package/build/lib/utils/index.js.map +1 -0
  41. package/build/lib/utils/inspector.d.ts +30 -0
  42. package/build/lib/utils/inspector.d.ts.map +1 -0
  43. package/build/lib/utils/inspector.js +91 -0
  44. package/build/lib/utils/inspector.js.map +1 -0
  45. package/build/lib/utils/javascript.d.ts +25 -0
  46. package/build/lib/utils/javascript.d.ts.map +1 -0
  47. package/build/lib/utils/javascript.js +90 -0
  48. package/build/lib/utils/javascript.js.map +1 -0
  49. package/build/lib/utils/module.d.ts +20 -0
  50. package/build/lib/utils/module.d.ts.map +1 -0
  51. package/build/lib/utils/module.js +36 -0
  52. package/build/lib/utils/module.js.map +1 -0
  53. package/build/lib/utils/object.d.ts +29 -0
  54. package/build/lib/utils/object.d.ts.map +1 -0
  55. package/build/lib/utils/object.js +54 -0
  56. package/build/lib/utils/object.js.map +1 -0
  57. package/build/lib/utils/platform.d.ts +7 -0
  58. package/build/lib/utils/platform.d.ts.map +1 -0
  59. package/build/lib/utils/platform.js +13 -0
  60. package/build/lib/utils/platform.js.map +1 -0
  61. package/lib/appium-ios-device.d.ts +12 -0
  62. package/lib/mixins/connect.ts +6 -6
  63. package/lib/mixins/execute.ts +2 -3
  64. package/lib/mixins/message-handlers.ts +4 -3
  65. package/lib/mixins/misc.ts +6 -5
  66. package/lib/mixins/navigate.ts +8 -3
  67. package/lib/remote-debugger-real-device.ts +1 -1
  68. package/lib/remote-debugger.ts +6 -8
  69. package/lib/rpc/rpc-client-real-device-shim.ts +3 -3
  70. package/lib/rpc/rpc-client.ts +16 -23
  71. package/lib/rpc/rpc-message-handler.ts +3 -4
  72. package/lib/utils/async.ts +32 -0
  73. package/lib/utils/errors.ts +19 -0
  74. package/lib/utils/index.ts +18 -0
  75. package/lib/utils/inspector.ts +99 -0
  76. package/lib/utils/javascript.ts +89 -0
  77. package/lib/utils/module.ts +33 -0
  78. package/lib/utils/object.ts +55 -0
  79. package/lib/utils/platform.ts +10 -0
  80. package/package.json +8 -2
  81. package/build/lib/utils.d.ts +0 -167
  82. package/build/lib/utils.d.ts.map +0 -1
  83. package/build/lib/utils.js +0 -422
  84. package/build/lib/utils.js.map +0 -1
  85. package/lib/utils.ts +0 -443
@@ -1,167 +0,0 @@
1
- import type { StringRecord } from '@appium/types';
2
- import type { AppInfo, AppDict, Page } from './types';
3
- export declare const WEB_CONTENT_BUNDLE_ID = "com.apple.WebKit.WebContent";
4
- export declare const RESPONSE_LOG_LENGTH = 100;
5
- export type CancellableDelay = Promise<void> & {
6
- cancel: () => void;
7
- };
8
- /**
9
- * Thrown when a cancellable delay is cancelled.
10
- */
11
- export declare class DelayCancellation extends Error {
12
- constructor(message?: string);
13
- }
14
- /**
15
- * Error thrown when an async operation exceeds the configured timeout.
16
- */
17
- export declare class TimeoutError extends Error {
18
- constructor(message?: string);
19
- }
20
- /**
21
- * Truncates a string to the requested length and appends ellipsis when needed.
22
- *
23
- * @param value - The input string.
24
- * @param length - Maximum output length.
25
- * @returns The original string when short enough, otherwise a truncated variant.
26
- */
27
- export declare function truncateString(value: string, length: number): string;
28
- /**
29
- * Creates a shallow object where undefined keys from `target` are filled
30
- * from `defaultsObj`.
31
- *
32
- * @param target - The object with priority values.
33
- * @param defaultsObj - The object providing fallback values.
34
- * @returns A new object containing merged defaulted values.
35
- */
36
- export declare function defaults<T extends Record<string, any>, U extends Record<string, any>>(target: T, defaultsObj: U): T & U;
37
- /**
38
- * Determines whether a value is a plain object.
39
- *
40
- * @param value - The value to check.
41
- * @returns True when the value is a non-null non-array object.
42
- */
43
- export declare function isPlainObject(value: unknown): value is Record<string, any>;
44
- /**
45
- * Checks whether a value should be treated as empty.
46
- *
47
- * @param value - The value to evaluate.
48
- * @returns True for nullish values, empty arrays/strings/maps/sets, or empty objects.
49
- */
50
- export declare function isEmpty(value: unknown): boolean;
51
- /**
52
- * Deduplicates array entries while preserving order.
53
- *
54
- * @param items - Items to deduplicate.
55
- * @returns The input items without duplicates.
56
- */
57
- export declare function uniq<T>(items: T[]): T[];
58
- /**
59
- * Performs deep strict equality comparison.
60
- *
61
- * @param a - First value.
62
- * @param b - Second value.
63
- * @returns True when both values are deeply equal.
64
- */
65
- export declare function deepEqual(a: unknown, b: unknown): boolean;
66
- /**
67
- * Returns a promise that resolves after the specified delay.
68
- *
69
- * @param ms - Delay in milliseconds.
70
- * @returns A promise that resolves when the delay expires.
71
- */
72
- export declare function delay(ms: number): Promise<void>;
73
- /**
74
- * Returns a delay promise with a `cancel` method that rejects the promise.
75
- *
76
- * @param ms - Delay in milliseconds.
77
- * @returns A cancellable delay promise.
78
- */
79
- export declare function cancellableDelay(ms: number): CancellableDelay;
80
- /**
81
- * Wraps a promise with a timeout.
82
- *
83
- * @param promise - The promise to resolve.
84
- * @param timeoutMs - Maximum time to wait in milliseconds.
85
- * @param message - Optional timeout message.
86
- * @returns A promise that resolves/rejects with the original promise result, or rejects on timeout.
87
- */
88
- export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, message?: string): Promise<T>;
89
- /**
90
- * Takes a dictionary from the remote debugger and converts it into a more
91
- * manageable AppInfo object with understandable keys.
92
- *
93
- * @param dict - Dictionary from the remote debugger containing application information.
94
- * @returns A tuple containing the application ID and the AppInfo object.
95
- */
96
- export declare function appInfoFromDict(dict: Record<string, any>): [string, AppInfo];
97
- /**
98
- * Takes a dictionary from the remote debugger and converts it into an array
99
- * of Page objects with understandable keys. Filters out non-web pages.
100
- *
101
- * @param pageDict - Dictionary from the remote debugger containing page information.
102
- * @returns An array of Page objects representing the available pages.
103
- */
104
- export declare function pageArrayFromDict(pageDict: StringRecord): Page[];
105
- /**
106
- * Finds all application identifier keys that match the given bundle ID.
107
- * If no matches are found and the bundle ID is not WEB_CONTENT_BUNDLE_ID,
108
- * falls back to searching for WEB_CONTENT_BUNDLE_ID.
109
- *
110
- * @param bundleId - The bundle identifier to search for.
111
- * @param appDict - The application dictionary to search in.
112
- * @returns An array of unique application identifier keys matching the bundle ID.
113
- */
114
- export declare function appIdsForBundle(bundleId: string, appDict: AppDict): string[];
115
- /**
116
- * Validates that all parameters in the provided object have non-nil values.
117
- * Throws an error if any parameters are missing (null or undefined).
118
- *
119
- * @template T - The type of the parameters object.
120
- * @param params - An object containing parameters to validate.
121
- * @returns The same parameters object if all values are valid.
122
- * @throws Error if any parameters are missing, listing all missing parameter names.
123
- */
124
- export declare function checkParams<T extends StringRecord>(params: T): T;
125
- /**
126
- * Converts a value to a best-effort JSON string for logging, removing noisy
127
- * function properties from cloneable objects when possible.
128
- *
129
- * Falls back to `String(value)` when JSON serialization returns `undefined`
130
- * or throws (for example, for functions, symbols, or circular structures).
131
- *
132
- * @param value - The value to stringify.
133
- * @param multiline - If true, formats JSON output with indentation. Defaults to false.
134
- * @returns A string representation suitable for logging.
135
- */
136
- export declare function simpleStringify(value: any, multiline?: boolean): string;
137
- /**
138
- * Converts the result from a JavaScript evaluation in the remote debugger
139
- * into a usable format. Handles errors, serialization, and cleans up noisy
140
- * function properties.
141
- *
142
- * @param res - The raw result from the remote debugger's JavaScript evaluation.
143
- * @returns The cleaned and converted result value.
144
- * @throws Error if the result is undefined, has an unexpected type, or contains
145
- * an error status code.
146
- */
147
- export declare function convertJavascriptEvaluationResult(res: any): any;
148
- /**
149
- * Calculates and memoizes the path to the current module root.
150
- *
151
- * @returns The full path to the module root directory.
152
- * @throws Error if the module root folder cannot be determined.
153
- */
154
- export declare function getModuleRoot(): string;
155
- /**
156
- * Reads and parses the package.json file from the module root.
157
- *
158
- * @returns The parsed package.json contents as a StringRecord.
159
- */
160
- export declare function getModuleProperties(): StringRecord;
161
- /**
162
- * Determines if the WebInspector shim can be used based on the provided iOS platform version.
163
- * @param platformVersion - The iOS platform version string (e.g., "18.0", "17.5.1")
164
- * @returns true if the WebInspector shim can be used, false otherwise
165
- */
166
- export declare function canUseWebInspectorShim(platformVersion: string): boolean;
167
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,SAAS,CAAC;AAGpD,eAAO,MAAM,qBAAqB,gCAAgC,CAAC;AAQnE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG;IAC7C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,GAAE,MAA0B;CAIhD;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,GAAE,MAA8B;CAIpD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnF,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,CAAC,GACb,CAAC,GAAG,CAAC,CAQP;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAM1E;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAc/C;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,KA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mBAAmB,IAAI,YAAY,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAEvE"}
@@ -1,422 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TimeoutError = exports.DelayCancellation = exports.RESPONSE_LOG_LENGTH = exports.WEB_CONTENT_BUNDLE_ID = void 0;
7
- exports.truncateString = truncateString;
8
- exports.defaults = defaults;
9
- exports.isPlainObject = isPlainObject;
10
- exports.isEmpty = isEmpty;
11
- exports.uniq = uniq;
12
- exports.deepEqual = deepEqual;
13
- exports.delay = delay;
14
- exports.cancellableDelay = cancellableDelay;
15
- exports.withTimeout = withTimeout;
16
- exports.appInfoFromDict = appInfoFromDict;
17
- exports.pageArrayFromDict = pageArrayFromDict;
18
- exports.appIdsForBundle = appIdsForBundle;
19
- exports.checkParams = checkParams;
20
- exports.simpleStringify = simpleStringify;
21
- exports.convertJavascriptEvaluationResult = convertJavascriptEvaluationResult;
22
- exports.getModuleRoot = getModuleRoot;
23
- exports.getModuleProperties = getModuleProperties;
24
- exports.canUseWebInspectorShim = canUseWebInspectorShim;
25
- const base_driver_1 = require("@appium/base-driver");
26
- const support_1 = require("@appium/support");
27
- const node_util_1 = require("node:util");
28
- const node_fs_1 = __importDefault(require("node:fs"));
29
- const node_path_1 = __importDefault(require("node:path"));
30
- const MODULE_NAME = 'appium-remote-debugger';
31
- exports.WEB_CONTENT_BUNDLE_ID = 'com.apple.WebKit.WebContent';
32
- const INACTIVE_APP_CODE = 0;
33
- // values for the page `WIRTypeKey` entry
34
- const ACCEPTED_PAGE_TYPES = [
35
- 'WIRTypeWeb', // up to iOS 11.3
36
- 'WIRTypeWebPage', // iOS 11.4
37
- 'WIRTypePage', // iOS 11.4 webview
38
- ];
39
- exports.RESPONSE_LOG_LENGTH = 100;
40
- /**
41
- * Thrown when a cancellable delay is cancelled.
42
- */
43
- class DelayCancellation extends Error {
44
- constructor(message = 'Delay cancelled') {
45
- super(message);
46
- this.name = 'DelayCancellation';
47
- }
48
- }
49
- exports.DelayCancellation = DelayCancellation;
50
- /**
51
- * Error thrown when an async operation exceeds the configured timeout.
52
- */
53
- class TimeoutError extends Error {
54
- constructor(message = 'Operation timed out') {
55
- super(message);
56
- this.name = 'TimeoutError';
57
- }
58
- }
59
- exports.TimeoutError = TimeoutError;
60
- /**
61
- * Truncates a string to the requested length and appends ellipsis when needed.
62
- *
63
- * @param value - The input string.
64
- * @param length - Maximum output length.
65
- * @returns The original string when short enough, otherwise a truncated variant.
66
- */
67
- function truncateString(value, length) {
68
- if (value.length <= length) {
69
- return value;
70
- }
71
- return `${value.slice(0, Math.max(0, length - 1))}…`;
72
- }
73
- /**
74
- * Creates a shallow object where undefined keys from `target` are filled
75
- * from `defaultsObj`.
76
- *
77
- * @param target - The object with priority values.
78
- * @param defaultsObj - The object providing fallback values.
79
- * @returns A new object containing merged defaulted values.
80
- */
81
- function defaults(target, defaultsObj) {
82
- const result = { ...target };
83
- for (const [key, value] of Object.entries(defaultsObj)) {
84
- if (result[key] === undefined) {
85
- result[key] = value;
86
- }
87
- }
88
- return result;
89
- }
90
- /**
91
- * Determines whether a value is a plain object.
92
- *
93
- * @param value - The value to check.
94
- * @returns True when the value is a non-null non-array object.
95
- */
96
- function isPlainObject(value) {
97
- if (value == null || typeof value !== 'object' || Array.isArray(value)) {
98
- return false;
99
- }
100
- const prototype = Object.getPrototypeOf(value);
101
- return prototype === Object.prototype || prototype === null;
102
- }
103
- /**
104
- * Checks whether a value should be treated as empty.
105
- *
106
- * @param value - The value to evaluate.
107
- * @returns True for nullish values, empty arrays/strings/maps/sets, or empty objects.
108
- */
109
- function isEmpty(value) {
110
- if (value == null) {
111
- return true;
112
- }
113
- if (Array.isArray(value) || typeof value === 'string') {
114
- return value.length === 0;
115
- }
116
- if (value instanceof Map || value instanceof Set) {
117
- return value.size === 0;
118
- }
119
- if (isPlainObject(value)) {
120
- return Object.keys(value).length === 0;
121
- }
122
- return false;
123
- }
124
- /**
125
- * Deduplicates array entries while preserving order.
126
- *
127
- * @param items - Items to deduplicate.
128
- * @returns The input items without duplicates.
129
- */
130
- function uniq(items) {
131
- return [...new Set(items)];
132
- }
133
- /**
134
- * Performs deep strict equality comparison.
135
- *
136
- * @param a - First value.
137
- * @param b - Second value.
138
- * @returns True when both values are deeply equal.
139
- */
140
- function deepEqual(a, b) {
141
- return (0, node_util_1.isDeepStrictEqual)(a, b);
142
- }
143
- /**
144
- * Returns a promise that resolves after the specified delay.
145
- *
146
- * @param ms - Delay in milliseconds.
147
- * @returns A promise that resolves when the delay expires.
148
- */
149
- function delay(ms) {
150
- return new Promise((resolve) => setTimeout(resolve, ms));
151
- }
152
- /**
153
- * Returns a delay promise with a `cancel` method that rejects the promise.
154
- *
155
- * @param ms - Delay in milliseconds.
156
- * @returns A cancellable delay promise.
157
- */
158
- function cancellableDelay(ms) {
159
- let timeoutId;
160
- let rejectFn;
161
- const promise = new Promise((resolve, reject) => {
162
- rejectFn = reject;
163
- timeoutId = setTimeout(resolve, ms);
164
- });
165
- promise.cancel = () => {
166
- if (timeoutId) {
167
- clearTimeout(timeoutId);
168
- timeoutId = undefined;
169
- }
170
- rejectFn?.(new DelayCancellation());
171
- rejectFn = undefined;
172
- };
173
- return promise;
174
- }
175
- /**
176
- * Wraps a promise with a timeout.
177
- *
178
- * @param promise - The promise to resolve.
179
- * @param timeoutMs - Maximum time to wait in milliseconds.
180
- * @param message - Optional timeout message.
181
- * @returns A promise that resolves/rejects with the original promise result, or rejects on timeout.
182
- */
183
- async function withTimeout(promise, timeoutMs, message) {
184
- let timeoutId;
185
- try {
186
- return await Promise.race([
187
- promise,
188
- new Promise((_resolve, reject) => {
189
- timeoutId = setTimeout(() => reject(new TimeoutError(message ?? `Operation timed out after ${timeoutMs}ms`)), timeoutMs);
190
- }),
191
- ]);
192
- }
193
- finally {
194
- if (timeoutId) {
195
- clearTimeout(timeoutId);
196
- }
197
- }
198
- }
199
- /**
200
- * Takes a dictionary from the remote debugger and converts it into a more
201
- * manageable AppInfo object with understandable keys.
202
- *
203
- * @param dict - Dictionary from the remote debugger containing application information.
204
- * @returns A tuple containing the application ID and the AppInfo object.
205
- */
206
- function appInfoFromDict(dict) {
207
- const id = dict.WIRApplicationIdentifierKey;
208
- const isProxy = typeof dict.WIRIsApplicationProxyKey === 'string'
209
- ? dict.WIRIsApplicationProxyKey.toLowerCase() === 'true'
210
- : dict.WIRIsApplicationProxyKey;
211
- // automation enabled can be either from the keys
212
- // - WIRRemoteAutomationEnabledKey (boolean)
213
- // - WIRAutomationAvailabilityKey (string or boolean)
214
- let isAutomationEnabled = !!dict.WIRRemoteAutomationEnabledKey;
215
- if (Object.hasOwn(dict, 'WIRAutomationAvailabilityKey')) {
216
- if (typeof dict.WIRAutomationAvailabilityKey === 'string') {
217
- isAutomationEnabled =
218
- dict.WIRAutomationAvailabilityKey === 'WIRAutomationAvailabilityUnknown'
219
- ? 'Unknown'
220
- : dict.WIRAutomationAvailabilityKey === 'WIRAutomationAvailabilityAvailable';
221
- }
222
- else {
223
- isAutomationEnabled = !!dict.WIRAutomationAvailabilityKey;
224
- }
225
- }
226
- const entry = {
227
- id,
228
- isProxy,
229
- name: dict.WIRApplicationNameKey,
230
- bundleId: dict.WIRApplicationBundleIdentifierKey,
231
- hostId: dict.WIRHostApplicationIdentifierKey,
232
- isActive: dict.WIRIsApplicationActiveKey !== INACTIVE_APP_CODE,
233
- isAutomationEnabled,
234
- };
235
- return [id, entry];
236
- }
237
- /**
238
- * Takes a dictionary from the remote debugger and converts it into an array
239
- * of Page objects with understandable keys. Filters out non-web pages.
240
- *
241
- * @param pageDict - Dictionary from the remote debugger containing page information.
242
- * @returns An array of Page objects representing the available pages.
243
- */
244
- function pageArrayFromDict(pageDict) {
245
- return (Object.values(pageDict)
246
- // count only WIRTypeWeb pages and ignore all others (WIRTypeJavaScript etc)
247
- .filter((dict) => dict.WIRTypeKey === undefined || ACCEPTED_PAGE_TYPES.includes(dict.WIRTypeKey))
248
- .map((dict) => ({
249
- id: dict.WIRPageIdentifierKey,
250
- title: dict.WIRTitleKey,
251
- url: dict.WIRURLKey,
252
- isKey: dict.WIRConnectionIdentifierKey !== undefined,
253
- })));
254
- }
255
- /**
256
- * Finds all application identifier keys that match the given bundle ID.
257
- * If no matches are found and the bundle ID is not WEB_CONTENT_BUNDLE_ID,
258
- * falls back to searching for WEB_CONTENT_BUNDLE_ID.
259
- *
260
- * @param bundleId - The bundle identifier to search for.
261
- * @param appDict - The application dictionary to search in.
262
- * @returns An array of unique application identifier keys matching the bundle ID.
263
- */
264
- function appIdsForBundle(bundleId, appDict) {
265
- const appIds = Object.entries(appDict)
266
- .filter(([, data]) => data.bundleId === bundleId)
267
- .map(([key]) => key);
268
- // if nothing is found, try to get the generic app
269
- if (appIds.length === 0 && bundleId !== exports.WEB_CONTENT_BUNDLE_ID) {
270
- return appIdsForBundle(exports.WEB_CONTENT_BUNDLE_ID, appDict);
271
- }
272
- return uniq(appIds);
273
- }
274
- /**
275
- * Validates that all parameters in the provided object have non-nil values.
276
- * Throws an error if any parameters are missing (null or undefined).
277
- *
278
- * @template T - The type of the parameters object.
279
- * @param params - An object containing parameters to validate.
280
- * @returns The same parameters object if all values are valid.
281
- * @throws Error if any parameters are missing, listing all missing parameter names.
282
- */
283
- function checkParams(params) {
284
- // check if all parameters have a value
285
- const errors = Object.entries(params)
286
- .filter(([, value]) => value == null)
287
- .map(([param]) => param);
288
- if (errors.length) {
289
- throw new Error(`Missing ${support_1.util.pluralize('parameter', errors.length)}: ${errors.join(', ')}`);
290
- }
291
- return params;
292
- }
293
- /**
294
- * Converts a value to a best-effort JSON string for logging, removing noisy
295
- * function properties from cloneable objects when possible.
296
- *
297
- * Falls back to `String(value)` when JSON serialization returns `undefined`
298
- * or throws (for example, for functions, symbols, or circular structures).
299
- *
300
- * @param value - The value to stringify.
301
- * @param multiline - If true, formats JSON output with indentation. Defaults to false.
302
- * @returns A string representation suitable for logging.
303
- */
304
- function simpleStringify(value, multiline = false) {
305
- const stringify = (val) => {
306
- try {
307
- return multiline
308
- ? (JSON.stringify(val, null, 2) ?? String(val))
309
- : (JSON.stringify(val) ?? String(val));
310
- }
311
- catch {
312
- return String(val);
313
- }
314
- };
315
- if (!value) {
316
- return stringify(value);
317
- }
318
- let cleanValue = value;
319
- if (typeof value === 'object' && value !== null) {
320
- try {
321
- cleanValue = removeNoisyProperties(structuredClone(value));
322
- }
323
- catch {
324
- // Fall back to the original value when cloning fails (e.g., non-cloneable graph entries).
325
- cleanValue = value;
326
- }
327
- }
328
- return stringify(cleanValue);
329
- }
330
- /**
331
- * Converts the result from a JavaScript evaluation in the remote debugger
332
- * into a usable format. Handles errors, serialization, and cleans up noisy
333
- * function properties.
334
- *
335
- * @param res - The raw result from the remote debugger's JavaScript evaluation.
336
- * @returns The cleaned and converted result value.
337
- * @throws Error if the result is undefined, has an unexpected type, or contains
338
- * an error status code.
339
- */
340
- function convertJavascriptEvaluationResult(res) {
341
- if (res === undefined) {
342
- throw new Error(`Did not get OK result from remote debugger. Result was: ${truncateString(simpleStringify(res), exports.RESPONSE_LOG_LENGTH)}`);
343
- }
344
- else if (typeof res === 'string') {
345
- try {
346
- res = JSON.parse(res);
347
- }
348
- catch {
349
- // we might get a serialized object, but we might not
350
- // if we get here, it is just a value
351
- }
352
- }
353
- else if ((typeof res !== 'object' && typeof res !== 'function') || res === null) {
354
- throw new Error(`Result has unexpected type: (${typeof res}).`);
355
- }
356
- if (Object.hasOwn(res, 'status') && res.status !== 0) {
357
- // we got some form of error.
358
- throw (0, base_driver_1.errorFromMJSONWPStatusCode)(res.status, res.value.message || res.value);
359
- }
360
- // with either have an object with a `value` property (even if `null`),
361
- // or a plain object
362
- const value = Object.hasOwn(res, 'value') ? res.value : res;
363
- return removeNoisyProperties(value);
364
- }
365
- /**
366
- * Calculates the path to the current module's root folder.
367
- * The result is memoized for performance.
368
- *
369
- * @returns The full path to the module root directory.
370
- * @throws Error if the module root folder cannot be determined.
371
- */
372
- let cachedModuleRoot;
373
- /**
374
- * Calculates and memoizes the path to the current module root.
375
- *
376
- * @returns The full path to the module root directory.
377
- * @throws Error if the module root folder cannot be determined.
378
- */
379
- function getModuleRoot() {
380
- if (cachedModuleRoot) {
381
- return cachedModuleRoot;
382
- }
383
- const root = support_1.node.getModuleRootSync(MODULE_NAME, __filename);
384
- if (!root) {
385
- throw new Error(`Cannot find the root folder of the ${MODULE_NAME} Node.js module`);
386
- }
387
- cachedModuleRoot = root;
388
- return root;
389
- }
390
- /**
391
- * Reads and parses the package.json file from the module root.
392
- *
393
- * @returns The parsed package.json contents as a StringRecord.
394
- */
395
- function getModuleProperties() {
396
- const fullPath = node_path_1.default.resolve(getModuleRoot(), 'package.json');
397
- return JSON.parse(node_fs_1.default.readFileSync(fullPath, 'utf8'));
398
- }
399
- /**
400
- * Determines if the WebInspector shim can be used based on the provided iOS platform version.
401
- * @param platformVersion - The iOS platform version string (e.g., "18.0", "17.5.1")
402
- * @returns true if the WebInspector shim can be used, false otherwise
403
- */
404
- function canUseWebInspectorShim(platformVersion) {
405
- return !!platformVersion && support_1.util.compareVersions(platformVersion, '>=', '18.0');
406
- }
407
- /**
408
- * Removes noisy function properties from an object that can muddy the logs.
409
- * These properties are often added by JavaScript number objects and similar.
410
- *
411
- * @param obj - The object to clean.
412
- * @returns The cleaned object.
413
- */
414
- function removeNoisyProperties(obj) {
415
- if (obj && typeof obj === 'object') {
416
- for (const property of ['ceil', 'clone', 'floor', 'round', 'scale', 'toString']) {
417
- delete obj[property];
418
- }
419
- }
420
- return obj;
421
- }
422
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":";;;;;;AAkDA,wCAKC;AAUD,4BAWC;AAQD,sCAMC;AAQD,0BAcC;AAQD,oB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