@limrun/api 0.25.2 → 0.26.1
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/CHANGELOG.md +8 -0
- package/folder-sync.d.mts +9 -0
- package/folder-sync.d.mts.map +1 -1
- package/folder-sync.d.ts +9 -0
- package/folder-sync.d.ts.map +1 -1
- package/folder-sync.js +45 -36
- package/folder-sync.js.map +1 -1
- package/folder-sync.mjs +44 -36
- package/folder-sync.mjs.map +1 -1
- package/ios-client.d.mts +6 -0
- package/ios-client.d.mts.map +1 -1
- package/ios-client.d.ts +6 -0
- package/ios-client.d.ts.map +1 -1
- package/ios-client.js +8 -4
- package/ios-client.js.map +1 -1
- package/ios-client.mjs +8 -4
- package/ios-client.mjs.map +1 -1
- package/package.json +3 -2
- package/src/folder-sync.ts +64 -32
- package/src/ios-client.ts +20 -3
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/ios-client.ts
CHANGED
|
@@ -283,6 +283,13 @@ export type InstanceClient = {
|
|
|
283
283
|
*/
|
|
284
284
|
elementTree: (point?: AccessibilityPoint) => Promise<ElementTree>;
|
|
285
285
|
|
|
286
|
+
/**
|
|
287
|
+
* Get the raw element tree string returned by the server.
|
|
288
|
+
* @param point Optional point to get the element at that specific location
|
|
289
|
+
* @returns A promise that resolves to the raw accessibility tree payload
|
|
290
|
+
*/
|
|
291
|
+
elementTreeRaw: (point?: AccessibilityPoint) => Promise<string>;
|
|
292
|
+
|
|
286
293
|
/**
|
|
287
294
|
* Tap at the specified coordinates (uses device's native screen dimensions)
|
|
288
295
|
* @param x X coordinate in points
|
|
@@ -684,6 +691,7 @@ type PendingRequest<T> = {
|
|
|
684
691
|
resolve: (value: T) => void;
|
|
685
692
|
reject: (reason: Error) => void;
|
|
686
693
|
timeout: NodeJS.Timeout;
|
|
694
|
+
transform?: (message: ServerResponse) => T;
|
|
687
695
|
};
|
|
688
696
|
|
|
689
697
|
// Simctl uses streaming, so it's handled separately
|
|
@@ -1164,6 +1172,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1164
1172
|
const sendRequest = <T>(
|
|
1165
1173
|
type: string,
|
|
1166
1174
|
params: Record<string, unknown> = {},
|
|
1175
|
+
transform?: (message: ServerResponse) => T,
|
|
1167
1176
|
timeoutMs: number = 30000,
|
|
1168
1177
|
): Promise<T> => {
|
|
1169
1178
|
return new Promise((resolve, reject) => {
|
|
@@ -1178,7 +1187,10 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1178
1187
|
reject(new Error(`Request ${type} timed out`));
|
|
1179
1188
|
}, timeoutMs);
|
|
1180
1189
|
|
|
1181
|
-
pendingRequests.set(
|
|
1190
|
+
pendingRequests.set(
|
|
1191
|
+
id,
|
|
1192
|
+
transform ? { resolve, reject, timeout, transform } : { resolve, reject, timeout },
|
|
1193
|
+
);
|
|
1182
1194
|
|
|
1183
1195
|
const request = { type, id, ...params };
|
|
1184
1196
|
logger.debug('Sending request:', request);
|
|
@@ -1313,7 +1325,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1313
1325
|
}
|
|
1314
1326
|
|
|
1315
1327
|
// Use handler to transform response, or resolve with raw message
|
|
1316
|
-
const handler = responseHandlers[message.type];
|
|
1328
|
+
const handler = request.transform ?? responseHandlers[message.type];
|
|
1317
1329
|
if (handler) {
|
|
1318
1330
|
try {
|
|
1319
1331
|
request.resolve(handler(message));
|
|
@@ -1388,6 +1400,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1388
1400
|
resolveConnection({
|
|
1389
1401
|
screenshot,
|
|
1390
1402
|
elementTree,
|
|
1403
|
+
elementTreeRaw,
|
|
1391
1404
|
tap,
|
|
1392
1405
|
tapWithScreenSize,
|
|
1393
1406
|
tapElement,
|
|
@@ -1438,6 +1451,10 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1438
1451
|
return sendRequest<ElementTree>('elementTree', { point });
|
|
1439
1452
|
};
|
|
1440
1453
|
|
|
1454
|
+
const elementTreeRaw = (point?: AccessibilityPoint): Promise<string> => {
|
|
1455
|
+
return sendRequest<string>('elementTree', { point }, (msg) => msg.json ?? '');
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1441
1458
|
const tap = (x: number, y: number): Promise<void> => {
|
|
1442
1459
|
return sendRequest<void>('tap', {
|
|
1443
1460
|
x,
|
|
@@ -1561,7 +1578,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1561
1578
|
// rather than sticking to sendRequest's 30s default.
|
|
1562
1579
|
const waitMs = actions.reduce((acc, a) => acc + (a.type === 'wait' ? Math.max(0, a.durationMs) : 0), 0);
|
|
1563
1580
|
const timeoutMs = options?.timeoutMs ?? 30_000 + waitMs + actions.length * 2_000;
|
|
1564
|
-
return sendRequest<PerformActionsResult>('performActions', { actions }, timeoutMs);
|
|
1581
|
+
return sendRequest<PerformActionsResult>('performActions', { actions }, undefined, timeoutMs);
|
|
1565
1582
|
};
|
|
1566
1583
|
|
|
1567
1584
|
const startRecording = async (opts?: { quality?: RecordingQuality }): Promise<void> => {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.26.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.26.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.26.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.26.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|