@limrun/api 0.20.2 → 0.21.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/CHANGELOG.md +30 -0
- package/client.d.mts +1 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +15 -17
- package/client.js.map +1 -1
- package/client.mjs +15 -17
- package/client.mjs.map +1 -1
- package/folder-sync.d.mts +1 -1
- package/folder-sync.d.mts.map +1 -1
- package/folder-sync.d.ts +1 -1
- package/folder-sync.d.ts.map +1 -1
- package/instance-client.d.mts +109 -0
- package/instance-client.d.mts.map +1 -1
- package/instance-client.d.ts +109 -0
- package/instance-client.d.ts.map +1 -1
- package/instance-client.js +262 -69
- package/instance-client.js.map +1 -1
- package/instance-client.mjs +262 -69
- package/instance-client.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/ios-client.d.mts +12 -4
- package/ios-client.d.mts.map +1 -1
- package/ios-client.d.ts +12 -4
- package/ios-client.d.ts.map +1 -1
- package/ios-client.js +7 -2
- package/ios-client.js.map +1 -1
- package/ios-client.mjs +7 -2
- package/ios-client.mjs.map +1 -1
- package/package.json +12 -1
- package/resources/android-instances.d.mts +1 -0
- package/resources/android-instances.d.mts.map +1 -1
- package/resources/android-instances.d.ts +1 -0
- package/resources/android-instances.d.ts.map +1 -1
- package/resources/ios-instances.d.mts +1 -1
- package/resources/ios-instances.d.mts.map +1 -1
- package/resources/ios-instances.d.ts +1 -1
- package/resources/ios-instances.d.ts.map +1 -1
- package/src/client.ts +18 -21
- package/src/folder-sync.ts +2 -2
- package/src/instance-client.ts +516 -96
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/ios-client.ts +25 -7
- package/src/resources/android-instances.ts +2 -0
- package/src/resources/ios-instances.ts +1 -1
- 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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { LimrunError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
7
|
+
*/
|
|
8
|
+
export function stringifyQuery(query: object | Record<string, unknown>) {
|
|
9
|
+
return Object.entries(query)
|
|
10
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
11
|
+
.map(([key, value]) => {
|
|
12
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
13
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
14
|
+
}
|
|
15
|
+
if (value === null) {
|
|
16
|
+
return `${encodeURIComponent(key)}=`;
|
|
17
|
+
}
|
|
18
|
+
throw new LimrunError(
|
|
19
|
+
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
20
|
+
);
|
|
21
|
+
})
|
|
22
|
+
.join('&');
|
|
23
|
+
}
|
package/src/internal/utils.ts
CHANGED
package/src/ios-client.ts
CHANGED
|
@@ -129,10 +129,9 @@ export type AppInstallationOptions = {
|
|
|
129
129
|
* Launch mode after installation:
|
|
130
130
|
* - 'ForegroundIfRunning': Bring to foreground if already running, otherwise launch
|
|
131
131
|
* - 'RelaunchIfRunning': Kill and relaunch if already running
|
|
132
|
-
* - 'FailIfRunning': Fail if the app is already running
|
|
133
132
|
* - undefined: Don't launch after installation
|
|
134
133
|
*/
|
|
135
|
-
launchMode?: 'ForegroundIfRunning' | 'RelaunchIfRunning'
|
|
134
|
+
launchMode?: 'ForegroundIfRunning' | 'RelaunchIfRunning';
|
|
136
135
|
};
|
|
137
136
|
|
|
138
137
|
/**
|
|
@@ -222,8 +221,18 @@ export type InstanceClient = {
|
|
|
222
221
|
/**
|
|
223
222
|
* Launch an installed app by bundle identifier
|
|
224
223
|
* @param bundleId Bundle identifier of the app to launch
|
|
224
|
+
* @param mode Optional launch mode:
|
|
225
|
+
* - 'ForegroundIfRunning' (default): bring to foreground if already running
|
|
226
|
+
* - 'RelaunchIfRunning': terminate and relaunch if already running
|
|
225
227
|
*/
|
|
226
|
-
launchApp: (bundleId: string) => Promise<void>;
|
|
228
|
+
launchApp: (bundleId: string, mode?: 'ForegroundIfRunning' | 'RelaunchIfRunning') => Promise<void>;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Terminate a running app by bundle identifier.
|
|
232
|
+
* Succeeds silently if the app is not currently running.
|
|
233
|
+
* @param bundleId Bundle identifier of the app to terminate
|
|
234
|
+
*/
|
|
235
|
+
terminateApp: (bundleId: string) => Promise<void>;
|
|
227
236
|
|
|
228
237
|
/**
|
|
229
238
|
* Fetch the last N lines of app logs (combined stdout/stderr)
|
|
@@ -294,7 +303,7 @@ export type InstanceClient = {
|
|
|
294
303
|
opts?: {
|
|
295
304
|
install?: boolean;
|
|
296
305
|
maxPatchBytes?: number;
|
|
297
|
-
launchMode?: 'ForegroundIfRunning' | 'RelaunchIfRunning'
|
|
306
|
+
launchMode?: 'ForegroundIfRunning' | 'RelaunchIfRunning';
|
|
298
307
|
watch?: boolean;
|
|
299
308
|
},
|
|
300
309
|
) => Promise<SyncFolderResult>;
|
|
@@ -1004,6 +1013,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1004
1013
|
pressKeyResult: () => undefined,
|
|
1005
1014
|
toggleKeyboardResult: () => undefined,
|
|
1006
1015
|
launchAppResult: () => undefined,
|
|
1016
|
+
terminateAppResult: () => undefined,
|
|
1007
1017
|
appLogTailResult: (msg) => msg.logs ?? '',
|
|
1008
1018
|
listAppsResult: (msg) => JSON.parse(msg.apps || '[]') as InstalledApp[],
|
|
1009
1019
|
listOpenFilesResult: (msg) => msg.files || [],
|
|
@@ -1181,6 +1191,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1181
1191
|
pressKey,
|
|
1182
1192
|
toggleKeyboard,
|
|
1183
1193
|
launchApp,
|
|
1194
|
+
terminateApp,
|
|
1184
1195
|
appLogTail,
|
|
1185
1196
|
streamAppLog,
|
|
1186
1197
|
streamSyslog,
|
|
@@ -1270,8 +1281,15 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1270
1281
|
return sendRequest<void>('toggleKeyboard');
|
|
1271
1282
|
};
|
|
1272
1283
|
|
|
1273
|
-
const launchApp = (
|
|
1274
|
-
|
|
1284
|
+
const launchApp = (
|
|
1285
|
+
bundleId: string,
|
|
1286
|
+
mode?: 'ForegroundIfRunning' | 'RelaunchIfRunning',
|
|
1287
|
+
): Promise<void> => {
|
|
1288
|
+
return sendRequest<void>('launchApp', { bundleId, mode });
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
const terminateApp = (bundleId: string): Promise<void> => {
|
|
1292
|
+
return sendRequest<void>('terminateApp', { bundleId });
|
|
1275
1293
|
};
|
|
1276
1294
|
|
|
1277
1295
|
const appLogTail = (bundleId: string, lines: number): Promise<string> => {
|
|
@@ -1328,7 +1346,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1328
1346
|
opts?: {
|
|
1329
1347
|
install?: boolean;
|
|
1330
1348
|
maxPatchBytes?: number;
|
|
1331
|
-
launchMode?: 'ForegroundIfRunning' | 'RelaunchIfRunning'
|
|
1349
|
+
launchMode?: 'ForegroundIfRunning' | 'RelaunchIfRunning';
|
|
1332
1350
|
watch?: boolean;
|
|
1333
1351
|
},
|
|
1334
1352
|
): Promise<SyncFolderResult> => {
|
|
@@ -198,7 +198,7 @@ export namespace IosInstanceCreateParams {
|
|
|
198
198
|
* Launch mode specifies how to launch the app after installation. If not given,
|
|
199
199
|
* the app won't be launched.
|
|
200
200
|
*/
|
|
201
|
-
launchMode?: 'ForegroundIfRunning' | 'RelaunchIfRunning'
|
|
201
|
+
launchMode?: 'ForegroundIfRunning' | 'RelaunchIfRunning';
|
|
202
202
|
|
|
203
203
|
url?: string;
|
|
204
204
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.21.0'; // 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.21.0";
|
|
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.21.0";
|
|
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.21.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|