@limrun/api 0.36.1 → 0.37.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/src/ios-client.ts CHANGED
@@ -561,12 +561,12 @@ export type InstanceClient = {
561
561
  /**
562
562
  * Export the simulator keychain and upload it to a presigned asset-storage URL.
563
563
  */
564
- exportKeychain: (options: { url: string }) => Promise<void>;
564
+ exportKeychain: (options: { url: string; encryptionKey: string }) => Promise<void>;
565
565
 
566
566
  /**
567
567
  * Download keychain state from a presigned asset-storage URL and apply it.
568
568
  */
569
- importKeychain: (options: { url: string }) => Promise<KeychainImportResult>;
569
+ importKeychain: (options: { url: string; encryptionKey: string }) => Promise<KeychainImportResult>;
570
570
 
571
571
  /**
572
572
  * Set the device orientation
@@ -1422,7 +1422,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
1422
1422
 
1423
1423
  const redactRequestForDebug = (request: Record<string, unknown>): Record<string, unknown> => {
1424
1424
  if (request['type'] !== 'launchApp') {
1425
- return request;
1425
+ return 'encryptionKey' in request ? { ...request, encryptionKey: '[REDACTED]' } : request;
1426
1426
  }
1427
1427
 
1428
1428
  const runtime = request['runtime'] as LaunchAppRuntime | undefined;
@@ -1850,14 +1850,22 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
1850
1850
  );
1851
1851
  };
1852
1852
 
1853
- const exportKeychain = async (keychainOptions: { url: string }): Promise<void> => {
1854
- await sendRequest<void>('exportKeychain', { url: keychainOptions.url }, undefined, 120_000);
1853
+ const exportKeychain = async (keychainOptions: { url: string; encryptionKey: string }): Promise<void> => {
1854
+ await sendRequest<void>(
1855
+ 'exportKeychain',
1856
+ { url: keychainOptions.url, encryptionKey: keychainOptions.encryptionKey },
1857
+ undefined,
1858
+ 120_000,
1859
+ );
1855
1860
  };
1856
1861
 
1857
- const importKeychain = async (keychainOptions: { url: string }): Promise<KeychainImportResult> => {
1862
+ const importKeychain = async (keychainOptions: {
1863
+ url: string;
1864
+ encryptionKey: string;
1865
+ }): Promise<KeychainImportResult> => {
1858
1866
  return sendRequest<KeychainImportResult>(
1859
1867
  'importKeychain',
1860
- { url: keychainOptions.url },
1868
+ { url: keychainOptions.url, encryptionKey: keychainOptions.encryptionKey },
1861
1869
  undefined,
1862
1870
  120_000,
1863
1871
  );
@@ -216,6 +216,12 @@ export namespace IosInstanceCreateParams {
216
216
 
217
217
  assetName?: string;
218
218
 
219
+ /**
220
+ * Base64/base64url-encoded 32-byte key used to decrypt Keychain assets.
221
+ * Required when kind is Keychain.
222
+ */
223
+ encryptionKey?: string;
224
+
219
225
  /**
220
226
  * Launch mode specifies how to launch the app after installation. If not given,
221
227
  * the app won't be launched.
@@ -224,8 +224,9 @@ export type RbeActiveBuild = {
224
224
  invocationId: string;
225
225
  /** RUNNING while in flight; terminal statuses appear only on the build-end event. */
226
226
  status: 'RUNNING' | (string & {});
227
- /** The bazel target pattern(s) of the invocation, when known. */
228
- pattern?: string[];
227
+ /** The bazel target pattern(s) of the invocation; null when the build has
228
+ * not reported one yet (the wire always carries the key). */
229
+ pattern?: string[] | null;
229
230
  };
230
231
 
231
232
  /** The terminal summary of a Bazel invocation, from the build stream's end event. */
@@ -235,6 +236,17 @@ export type RbeBuildEnd = {
235
236
  error?: string;
236
237
  };
237
238
 
239
+ /** A Bazel invocation from the instance's bounded recent view: in flight or
240
+ * recently finished with its terminal status. */
241
+ export type RbeBuildSummary = {
242
+ invocationId: string;
243
+ status: 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED' | 'INCOMPLETE' | (string & {});
244
+ /** The bazel target pattern(s) of the invocation; null when the build never
245
+ * reported one (e.g. its event stream dropped early). */
246
+ pattern?: string[] | null;
247
+ error?: string | null;
248
+ };
249
+
238
250
  export type XcodeClient = {
239
251
  /**
240
252
  * Sync source code to the xcode instance. In watch mode, keeps syncing on changes.
@@ -302,6 +314,16 @@ export type XcodeClient = {
302
314
  */
303
315
  getActiveRbeBuilds: () => Promise<RbeActiveBuild[]>;
304
316
 
317
+ /**
318
+ * List the instance's recent Bazel invocations: in flight plus a bounded
319
+ * number of recently finished ones with their terminal status. Poll this to
320
+ * react to build ends (live streams are removed the moment a build ends, so
321
+ * the recent view is the reliable discovery surface). Retention is scoped
322
+ * to the RBE session: stopping the stack clears it. Durable history lives
323
+ * in the build records.
324
+ */
325
+ getRecentRbeBuilds: () => Promise<RbeBuildSummary[]>;
326
+
305
327
  /**
306
328
  * Wait for a Bazel invocation to finish and return its terminal summary.
307
329
  * Subscribes to the invocation's build event stream (which replays from the
@@ -759,6 +781,18 @@ export class XcodeInstances extends GeneratedXcodeInstances {
759
781
  return readRbeResponse<RbeActiveBuild[]>(res, 'GET /rbe/builds/active');
760
782
  },
761
783
 
784
+ async getRecentRbeBuilds(): Promise<RbeBuildSummary[]> {
785
+ const res = await nodeProxyTransport.fetch(`${apiUrl}/rbe/builds/recent`, {
786
+ method: 'GET',
787
+ headers: {
788
+ Authorization: `Bearer ${token}`,
789
+ },
790
+ });
791
+ // readRbeResponse: a 404 here means a limbuild that predates this
792
+ // route, not a vanished instance (same trap as the other /rbe routes).
793
+ return readRbeResponse<RbeBuildSummary[]>(res, 'GET /rbe/builds/recent');
794
+ },
795
+
762
796
  waitForRbeBuildEnd(invocationId: string, opts?: { signal?: AbortSignal }): Promise<RbeBuildEnd> {
763
797
  return new Promise<RbeBuildEnd>((resolve, reject) => {
764
798
  if (opts?.signal?.aborted) {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.36.1'; // x-release-please-version
1
+ export const VERSION = '0.37.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.36.1";
1
+ export declare const VERSION = "0.37.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.36.1";
1
+ export declare const VERSION = "0.37.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.36.1'; // x-release-please-version
4
+ exports.VERSION = '0.37.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.36.1'; // x-release-please-version
1
+ export const VERSION = '0.37.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map