@limrun/api 0.46.13 → 0.47.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 (72) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/exec-client.d.mts +13 -1
  3. package/exec-client.d.mts.map +1 -1
  4. package/exec-client.d.ts +13 -1
  5. package/exec-client.d.ts.map +1 -1
  6. package/exec-client.js.map +1 -1
  7. package/exec-client.mjs.map +1 -1
  8. package/folder-sync-ignore.d.mts +4 -3
  9. package/folder-sync-ignore.d.mts.map +1 -1
  10. package/folder-sync-ignore.d.ts +4 -3
  11. package/folder-sync-ignore.d.ts.map +1 -1
  12. package/folder-sync-ignore.js +13 -7
  13. package/folder-sync-ignore.js.map +1 -1
  14. package/folder-sync-ignore.mjs +13 -7
  15. package/folder-sync-ignore.mjs.map +1 -1
  16. package/instance-client.d.mts +51 -1
  17. package/instance-client.d.mts.map +1 -1
  18. package/instance-client.d.ts +51 -1
  19. package/instance-client.d.ts.map +1 -1
  20. package/instance-client.js +46 -0
  21. package/instance-client.js.map +1 -1
  22. package/instance-client.mjs +46 -0
  23. package/instance-client.mjs.map +1 -1
  24. package/ios-client.d.mts +21 -0
  25. package/ios-client.d.mts.map +1 -1
  26. package/ios-client.d.ts +21 -0
  27. package/ios-client.d.ts.map +1 -1
  28. package/ios-client.js +27 -0
  29. package/ios-client.js.map +1 -1
  30. package/ios-client.mjs +27 -0
  31. package/ios-client.mjs.map +1 -1
  32. package/package.json +1 -1
  33. package/resources/daemon-client-shared.d.mts +9 -0
  34. package/resources/daemon-client-shared.d.mts.map +1 -1
  35. package/resources/daemon-client-shared.d.ts +9 -0
  36. package/resources/daemon-client-shared.d.ts.map +1 -1
  37. package/resources/daemon-client-shared.js +11 -1
  38. package/resources/daemon-client-shared.js.map +1 -1
  39. package/resources/daemon-client-shared.mjs +10 -1
  40. package/resources/daemon-client-shared.mjs.map +1 -1
  41. package/resources/gradle-instances-helpers.d.mts +8 -0
  42. package/resources/gradle-instances-helpers.d.mts.map +1 -1
  43. package/resources/gradle-instances-helpers.d.ts +8 -0
  44. package/resources/gradle-instances-helpers.d.ts.map +1 -1
  45. package/resources/gradle-instances-helpers.js +1 -1
  46. package/resources/gradle-instances-helpers.js.map +1 -1
  47. package/resources/gradle-instances-helpers.mjs +1 -1
  48. package/resources/gradle-instances-helpers.mjs.map +1 -1
  49. package/resources/xcode-instances-helpers.d.mts +46 -3
  50. package/resources/xcode-instances-helpers.d.mts.map +1 -1
  51. package/resources/xcode-instances-helpers.d.ts +46 -3
  52. package/resources/xcode-instances-helpers.d.ts.map +1 -1
  53. package/resources/xcode-instances-helpers.js +2 -1
  54. package/resources/xcode-instances-helpers.js.map +1 -1
  55. package/resources/xcode-instances-helpers.mjs +2 -1
  56. package/resources/xcode-instances-helpers.mjs.map +1 -1
  57. package/src/exec-client.ts +13 -1
  58. package/src/folder-sync-ignore.ts +12 -7
  59. package/src/instance-client.ts +114 -1
  60. package/src/ios-client.ts +51 -0
  61. package/src/resources/daemon-client-shared.ts +11 -1
  62. package/src/resources/gradle-instances-helpers.ts +22 -8
  63. package/src/resources/xcode-instances-helpers.ts +48 -4
  64. package/src/version.ts +1 -1
  65. package/version.d.mts +1 -1
  66. package/version.d.mts.map +1 -1
  67. package/version.d.ts +1 -1
  68. package/version.d.ts.map +1 -1
  69. package/version.js +1 -1
  70. package/version.js.map +1 -1
  71. package/version.mjs +1 -1
  72. package/version.mjs.map +1 -1
package/src/ios-client.ts CHANGED
@@ -270,6 +270,18 @@ export type ContainerTargetOptions = {
270
270
  containerType?: string;
271
271
  };
272
272
 
273
+ /** A file or directory inside the simulator staging folder or an app container. */
274
+ export type IosFileEntry = {
275
+ /** Entry name within the listed directory. */
276
+ name: string;
277
+ /** Entry path relative to the selected storage root; usable with pullFile/pushFile/deleteFile. */
278
+ path: string;
279
+ /** Whether the entry is a directory. */
280
+ isDirectory: boolean;
281
+ /** File size in bytes. Omitted for directories. */
282
+ size?: number;
283
+ };
284
+
273
285
  /**
274
286
  * Options for playing a video file as the simulated camera feed.
275
287
  */
@@ -949,6 +961,17 @@ export type InstanceClient = {
949
961
  */
950
962
  pullFile: (name: string, opts?: ContainerTargetOptions) => Promise<Buffer>;
951
963
 
964
+ /**
965
+ * List a directory in the simulator staging folder or an app container.
966
+ *
967
+ * Returned paths are relative to the selected storage root and can be passed
968
+ * directly to `pullFile`, `pushFile`, or `deleteFile` with the same options.
969
+ *
970
+ * @param path Relative directory to list. Empty or `.` lists the storage root.
971
+ * @param opts Optional app container targeting (see `pushFile`).
972
+ */
973
+ listFiles: (path?: string, opts?: ContainerTargetOptions) => Promise<IosFileEntry[]>;
974
+
952
975
  /**
953
976
  * Delete a file or folder (recursively) on the simulator.
954
977
  *
@@ -2023,6 +2046,7 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
2023
2046
  xcodebuild,
2024
2047
  pushFile,
2025
2048
  pullFile,
2049
+ listFiles,
2026
2050
  deleteFile,
2027
2051
  setCameraVideo,
2028
2052
  clearCameraVideo,
@@ -2612,6 +2636,33 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
2612
2636
  return Buffer.from(await response.arrayBuffer());
2613
2637
  };
2614
2638
 
2639
+ const listFiles = async (path = '.', opts?: ContainerTargetOptions): Promise<IosFileEntry[]> => {
2640
+ const params = new URLSearchParams();
2641
+ if (path && path !== '.') {
2642
+ params.set('path', path);
2643
+ }
2644
+ if (opts?.bundleId) {
2645
+ params.set('bundleId', opts.bundleId);
2646
+ if (opts.containerType) {
2647
+ params.set('containerType', opts.containerType);
2648
+ }
2649
+ }
2650
+ const query = params.toString();
2651
+ const url = `${options.apiUrl}/files/list${query ? `?${query}` : ''}`;
2652
+ const response = await nodeProxyTransport.fetch(url, {
2653
+ method: 'GET',
2654
+ headers: {
2655
+ Authorization: `Bearer ${options.token}`,
2656
+ },
2657
+ });
2658
+ if (!response.ok) {
2659
+ const errorBody = await response.text();
2660
+ throw new Error(`Listing of '${path}' failed: ${response.status} ${errorBody}`);
2661
+ }
2662
+ const result = (await response.json()) as { entries: IosFileEntry[] };
2663
+ return result.entries;
2664
+ };
2665
+
2615
2666
  const deleteFile = async (name: string, opts?: ContainerTargetOptions): Promise<void> => {
2616
2667
  const response = await nodeProxyTransport.fetch(buildFilesUrl(name, opts), {
2617
2668
  method: 'DELETE',
@@ -88,9 +88,19 @@ export type AssetUploadOptions = {
88
88
  deeplink?: string;
89
89
  };
90
90
 
91
+ /**
92
+ * Default TTL for build-product uploads. Every build upload without an
93
+ * explicit ttl pushes the asset's expiry to 14 days from that upload, so
94
+ * abandoned build artifacts don't accumulate in Asset Storage forever.
95
+ * Assets uploaded through the general asset API keep no expiry by default.
96
+ */
97
+ export const DEFAULT_BUILD_ASSET_TTL = '336h';
98
+
91
99
  /**
92
100
  * Mints presigned upload/download URLs for a named asset via assets.getOrCreate,
93
101
  * wrapping failures with the asset name (and the original error as cause).
102
+ * All build-product upload paths (xcodebuild, gradlebuild, RBE) go through
103
+ * here, which is what scopes DEFAULT_BUILD_ASSET_TTL to build uploads.
94
104
  */
95
105
  export function mintAssetUploadUrls(
96
106
  assets: {
@@ -100,7 +110,7 @@ export function mintAssetUploadUrls(
100
110
  ttl?: string,
101
111
  uploadOptions?: AssetUploadOptions,
102
112
  ): Promise<AssetUploadUrls> {
103
- return assets.getOrCreate({ name, ...(ttl && { ttl }), ...uploadOptions }).catch((err) => {
113
+ return assets.getOrCreate({ name, ttl: ttl || DEFAULT_BUILD_ASSET_TTL, ...uploadOptions }).catch((err) => {
104
114
  const message = `Failed to create upload URL for asset '${name}': ${
105
115
  err instanceof Error ? err.message : err
106
116
  }`;
@@ -56,7 +56,19 @@ export type GradleBuildOptions = {
56
56
  /** Relative path to the Gradle root when auto-discovery is ambiguous. */
57
57
  projectPath?: string;
58
58
  /** Upload the built artifact as a named org asset, or to a presigned URL. */
59
- upload?: { assetName: string; signedUploadUrl?: never } | { signedUploadUrl: string; assetName?: never };
59
+ upload?:
60
+ | {
61
+ assetName: string;
62
+ /**
63
+ * Asset TTL as a Go duration (e.g. "24h", "30m"; "1d" is invalid),
64
+ * forwarded to assets.getOrCreate. Defaults to 336h (14 days): each
65
+ * build upload without an explicit ttl pushes the asset's expiry to
66
+ * 14 days from that upload.
67
+ */
68
+ ttl?: string;
69
+ signedUploadUrl?: never;
70
+ }
71
+ | { signedUploadUrl: string; assetName?: never; ttl?: never };
60
72
  /** React Native / Expo tuning. */
61
73
  reactNative?: GradleReactNativeConfig;
62
74
  /** Release signing config; presence makes bundleRelease the default task. */
@@ -183,13 +195,15 @@ class GradleInstancesHelpers extends GradleInstances {
183
195
  };
184
196
 
185
197
  if (options?.upload && 'assetName' in options.upload) {
186
- const requestPromise = mintAssetUploadUrls(client.assets, options.upload.assetName).then(
187
- (asset) => {
188
- request.signedUploadUrl = asset.signedUploadUrl;
189
- request.additionalMetadata = { signedDownloadUrl: asset.signedDownloadUrl };
190
- return request;
191
- },
192
- );
198
+ const requestPromise = mintAssetUploadUrls(
199
+ client.assets,
200
+ options.upload.assetName,
201
+ options.upload.ttl,
202
+ ).then((asset) => {
203
+ request.signedUploadUrl = asset.signedUploadUrl;
204
+ request.additionalMetadata = { signedDownloadUrl: asset.signedDownloadUrl };
205
+ return request;
206
+ });
193
207
  return exec(requestPromise, { apiUrl, token, log });
194
208
  }
195
209
 
@@ -90,8 +90,12 @@ export type SyncOptions = {
90
90
  export type XcodeRunOptions = {
91
91
  /** Working directory relative to the synced workspace root. Defaults to ".". */
92
92
  cwd?: string;
93
- /** Environment variables to add to limbuild's curated sandbox environment. */
94
- env?: Record<string, string>;
93
+ /**
94
+ * Ordered KEY=VALUE entries added to limbuild's curated sandbox
95
+ * environment. Server-managed variables (PATH, HOME, ...) cannot be
96
+ * overridden; when a key repeats, the last entry wins.
97
+ */
98
+ env?: string[];
95
99
  /** Server-side timeout in seconds. Defaults to 3600; maximum 21600. */
96
100
  timeoutSeconds?: number;
97
101
  };
@@ -105,6 +109,14 @@ export type XcodeProjectConfig = {
105
109
  * Debug for native Xcode builds and Release for React Native / Expo builds.
106
110
  */
107
111
  configuration?: 'Debug' | 'Release';
112
+ /**
113
+ * Full filename of the built app bundle, including the .app extension
114
+ * (e.g. "MyApp-dev.app"). When set, limbuild takes the artifact from
115
+ * this name in the built products directory verbatim, skipping artifact
116
+ * discovery. Use when the scheme name differs from the product name and
117
+ * discovery picks the wrong bundle.
118
+ */
119
+ artifactName?: string;
108
120
  };
109
121
 
110
122
  export type XcodeGenConfig = {
@@ -173,12 +185,28 @@ export type ReactNativeBuildConfig = {
173
185
  * server URL you want opened.
174
186
  */
175
187
  devServerURL?: string;
188
+ /**
189
+ * Run `expo prebuild` even when the synced workspace already contains the
190
+ * native ios/ tree, regenerating it in place. Use when the tree holds
191
+ * client-synced files the server treats as user-owned (for example
192
+ * committed Podfile customizations) while the Xcode project itself is
193
+ * generated and gitignored. Requires a detectable Expo project. Older
194
+ * limbuild servers silently ignore this option.
195
+ */
196
+ expoForcePrebuild?: boolean;
176
197
  };
177
198
 
178
199
  export type XcodeBuildOptions = {
179
200
  upload?:
180
201
  | {
181
202
  assetName: string;
203
+ /**
204
+ * Asset TTL as a Go duration (e.g. "24h", "30m"; "1d" is invalid),
205
+ * forwarded to assets.getOrCreate. Defaults to 336h (14 days): each
206
+ * build upload without an explicit ttl pushes the asset's expiry to
207
+ * 14 days from that upload.
208
+ */
209
+ ttl?: string;
182
210
  /**
183
211
  * App metadata to record on the asset up front. limbuild extracts
184
212
  * the same metadata from the built bundle after the build and
@@ -207,6 +235,16 @@ export type XcodeBuildOptions = {
207
235
  */
208
236
  xcodegen?: XcodeGenConfig;
209
237
  buildSettings?: Record<string, string>;
238
+ /**
239
+ * Ordered KEY=VALUE entries added to the environment of every build
240
+ * pipeline command (dependency installs, expo prebuild, pod install,
241
+ * xcodebuild and its script phases). Server-managed variables (PATH,
242
+ * HOME, ...) cannot be overridden; when a key repeats, the last entry
243
+ * wins. Dependency installs always include devDependencies, so
244
+ * NODE_ENV=production cannot break them. Older limbuild servers
245
+ * silently ignore this option.
246
+ */
247
+ env?: string[];
210
248
  /**
211
249
  * Run `git init` in the synced workspace before project generation,
212
250
  * dependency resolution, and xcodebuild.
@@ -323,7 +361,12 @@ export type RbeUploadOptions =
323
361
  | {
324
362
  /** Upload as a named asset: the SDK mints the presigned upload URL via assets.getOrCreate. */
325
363
  assetName: string;
326
- /** Optional asset TTL as a Go duration (e.g. "24h", "30m"; "1d" is invalid), forwarded to assets.getOrCreate. */
364
+ /**
365
+ * Optional asset TTL as a Go duration (e.g. "24h", "30m"; "1d" is
366
+ * invalid), forwarded to assets.getOrCreate. Defaults to 336h (14
367
+ * days): each upload without an explicit ttl pushes the asset's
368
+ * expiry to 14 days from that upload.
369
+ */
327
370
  ttl?: string;
328
371
  signedUploadUrl?: never;
329
372
  }
@@ -813,6 +856,7 @@ export class XcodeInstances extends GeneratedXcodeInstances {
813
856
  // testflight until the exec API is revised separately.
814
857
  ...(options?.appstore && { testflight: options.appstore }),
815
858
  ...(options?.buildSettings && { buildSettings: options.buildSettings }),
859
+ ...(options?.env?.length && { env: options.env }),
816
860
  ...(options?.gitInit !== undefined && { gitInit: options.gitInit }),
817
861
  ...(options?.webhook && { webhook: options.webhook }),
818
862
  };
@@ -821,7 +865,7 @@ export class XcodeInstances extends GeneratedXcodeInstances {
821
865
  const requestPromise = mintAssetUploadUrls(
822
866
  client.assets,
823
867
  options.upload.assetName,
824
- undefined,
868
+ options.upload.ttl,
825
869
  options.upload.uploadOptions,
826
870
  ).then((asset) => {
827
871
  request.signedUploadUrl = asset.signedUploadUrl;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.46.13'; // x-release-please-version
1
+ export const VERSION = '0.47.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.46.13";
1
+ export declare const VERSION = "0.47.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.46.13";
1
+ export declare const VERSION = "0.47.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
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.46.13'; // x-release-please-version
4
+ exports.VERSION = '0.47.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,SAAS,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.46.13'; // x-release-please-version
1
+ export const VERSION = '0.47.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}