@limrun/api 0.36.0 → 0.36.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/ios-client.d.mts +15 -0
  3. package/ios-client.d.mts.map +1 -1
  4. package/ios-client.d.ts +15 -0
  5. package/ios-client.d.ts.map +1 -1
  6. package/ios-client.js +12 -0
  7. package/ios-client.js.map +1 -1
  8. package/ios-client.mjs +12 -0
  9. package/ios-client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/assets-helpers.d.mts +11 -1
  12. package/resources/assets-helpers.d.mts.map +1 -1
  13. package/resources/assets-helpers.d.ts +11 -1
  14. package/resources/assets-helpers.d.ts.map +1 -1
  15. package/resources/assets-helpers.js +6 -0
  16. package/resources/assets-helpers.js.map +1 -1
  17. package/resources/assets-helpers.mjs +6 -0
  18. package/resources/assets-helpers.mjs.map +1 -1
  19. package/resources/assets.d.mts +14 -3
  20. package/resources/assets.d.mts.map +1 -1
  21. package/resources/assets.d.ts +14 -3
  22. package/resources/assets.d.ts.map +1 -1
  23. package/resources/index.d.mts +1 -1
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +1 -1
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs.map +1 -1
  29. package/resources/ios-instances.d.mts +1 -1
  30. package/resources/ios-instances.d.mts.map +1 -1
  31. package/resources/ios-instances.d.ts +1 -1
  32. package/resources/ios-instances.d.ts.map +1 -1
  33. package/src/ios-client.ts +35 -0
  34. package/src/resources/assets-helpers.ts +19 -1
  35. package/src/resources/assets.ts +23 -2
  36. package/src/resources/index.ts +2 -0
  37. package/src/resources/ios-instances.ts +1 -1
  38. package/src/version.ts +1 -1
  39. package/version.d.mts +1 -1
  40. package/version.d.ts +1 -1
  41. package/version.js +1 -1
  42. package/version.mjs +1 -1
package/src/ios-client.ts CHANGED
@@ -201,6 +201,10 @@ export type AppInstallationResult = {
201
201
  bundleId: string;
202
202
  };
203
203
 
204
+ export type KeychainImportResult = {
205
+ durationMs: number;
206
+ };
207
+
204
208
  export type HttpProxyOptions = {
205
209
  remoteBaseUrl: string;
206
210
  localPort: number;
@@ -554,6 +558,16 @@ export type InstanceClient = {
554
558
  */
555
559
  installApp: (url: string, options?: AppInstallationOptions) => Promise<AppInstallationResult>;
556
560
 
561
+ /**
562
+ * Export the simulator keychain and upload it to a presigned asset-storage URL.
563
+ */
564
+ exportKeychain: (options: { url: string }) => Promise<void>;
565
+
566
+ /**
567
+ * Download keychain state from a presigned asset-storage URL and apply it.
568
+ */
569
+ importKeychain: (options: { url: string }) => Promise<KeychainImportResult>;
570
+
557
571
  /**
558
572
  * Set the device orientation
559
573
  * @param orientation The orientation to set ("Portrait" or "Landscape")
@@ -952,6 +966,8 @@ type ServerResponse = {
952
966
  lines?: string[];
953
967
  // performActions batch result fields
954
968
  results?: PerformActionResult[];
969
+ // Keychain transfer result fields
970
+ durationMs?: number;
955
971
  };
956
972
 
957
973
  /**
@@ -1492,6 +1508,10 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
1492
1508
  url: msg.url || '',
1493
1509
  bundleId: msg.bundleId || '',
1494
1510
  }),
1511
+ keychainExportResult: () => undefined,
1512
+ keychainImportResult: (msg): KeychainImportResult => ({
1513
+ durationMs: msg.durationMs ?? 0,
1514
+ }),
1495
1515
  startVideoRecordingResult: () => undefined,
1496
1516
  stopVideoRecordingResult: () => undefined,
1497
1517
  setOrientationResult: () => undefined,
@@ -1669,6 +1689,8 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
1669
1689
  listApps,
1670
1690
  openUrl,
1671
1691
  installApp,
1692
+ exportKeychain,
1693
+ importKeychain,
1672
1694
  setOrientation,
1673
1695
  scroll,
1674
1696
  performActions,
@@ -1828,6 +1850,19 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
1828
1850
  );
1829
1851
  };
1830
1852
 
1853
+ const exportKeychain = async (keychainOptions: { url: string }): Promise<void> => {
1854
+ await sendRequest<void>('exportKeychain', { url: keychainOptions.url }, undefined, 120_000);
1855
+ };
1856
+
1857
+ const importKeychain = async (keychainOptions: { url: string }): Promise<KeychainImportResult> => {
1858
+ return sendRequest<KeychainImportResult>(
1859
+ 'importKeychain',
1860
+ { url: keychainOptions.url },
1861
+ undefined,
1862
+ 120_000,
1863
+ );
1864
+ };
1865
+
1831
1866
  const setOrientation = (orientation: 'Portrait' | 'Landscape'): Promise<void> => {
1832
1867
  return sendRequest<void>('setOrientation', { orientation });
1833
1868
  };
@@ -4,7 +4,7 @@ import { promises as fs } from 'fs';
4
4
 
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
  import { nodeProxyTransport } from '../internal/proxy-transport';
7
- import { Assets as GeneratedAssets } from './assets';
7
+ import { Assets as GeneratedAssets, type AssetKind, type AssetPlatform } from './assets';
8
8
 
9
9
  export interface AssetGetOrUploadParams {
10
10
  /**
@@ -23,12 +23,24 @@ export interface AssetGetOrUploadParams {
23
23
  * a value updates the expiry while omitting it leaves the current expiry unchanged.
24
24
  */
25
25
  ttl?: string;
26
+
27
+ /**
28
+ * Asset kind. Defaults to App for file uploads.
29
+ */
30
+ kind?: Extract<AssetKind, 'App'>;
31
+
32
+ /**
33
+ * Optional platform for the asset.
34
+ */
35
+ platform?: AssetPlatform;
26
36
  }
27
37
 
28
38
  export interface AssetGetOrUploadResponse {
29
39
  id: string;
30
40
  name: string;
31
41
  signedDownloadUrl: string;
42
+ kind: AssetKind;
43
+ platform?: AssetPlatform;
32
44
  md5: string;
33
45
  expiresAt?: string;
34
46
  }
@@ -41,6 +53,8 @@ export class Assets extends GeneratedAssets {
41
53
  const creationResponse = await this.getOrCreate(
42
54
  {
43
55
  name: body.name ?? basename(body.path),
56
+ kind: body.kind ?? 'App',
57
+ ...(body.platform && { platform: body.platform }),
44
58
  ...(body.ttl && { ttl: body.ttl }),
45
59
  },
46
60
  options,
@@ -52,6 +66,8 @@ export class Assets extends GeneratedAssets {
52
66
  id: creationResponse.id,
53
67
  name: creationResponse.name,
54
68
  signedDownloadUrl: creationResponse.signedDownloadUrl,
69
+ kind: creationResponse.kind,
70
+ ...(creationResponse.platform && { platform: creationResponse.platform }),
55
71
  md5: creationResponse.md5,
56
72
  ...(creationResponse.expiresAt && { expiresAt: creationResponse.expiresAt }),
57
73
  };
@@ -71,6 +87,8 @@ export class Assets extends GeneratedAssets {
71
87
  id: creationResponse.id,
72
88
  name: creationResponse.name,
73
89
  signedDownloadUrl: creationResponse.signedDownloadUrl,
90
+ kind: creationResponse.kind,
91
+ ...(creationResponse.platform && { platform: creationResponse.platform }),
74
92
  md5,
75
93
  ...(creationResponse.expiresAt && { expiresAt: creationResponse.expiresAt }),
76
94
  };
@@ -56,6 +56,8 @@ export interface Asset {
56
56
 
57
57
  name: string;
58
58
 
59
+ kind: AssetKind;
60
+
59
61
  /**
60
62
  * Human-readable display name for the asset. If not set, the name should be used.
61
63
  */
@@ -72,10 +74,10 @@ export interface Asset {
72
74
  md5?: string;
73
75
 
74
76
  /**
75
- * The operating system this asset is for. If not set, the asset is available for
77
+ * The platform this asset is for. If not set, the asset is available for
76
78
  * all platforms.
77
79
  */
78
- os?: 'ios' | 'android';
80
+ platform?: AssetPlatform;
79
81
 
80
82
  signedDownloadUrl?: string;
81
83
 
@@ -89,10 +91,14 @@ export interface AssetGetOrCreateResponse {
89
91
 
90
92
  name: string;
91
93
 
94
+ kind: AssetKind;
95
+
92
96
  signedDownloadUrl: string;
93
97
 
94
98
  signedUploadUrl: string;
95
99
 
100
+ platform?: AssetPlatform;
101
+
96
102
  /**
97
103
  * When set, the time after which the asset is automatically deleted.
98
104
  */
@@ -121,6 +127,11 @@ export interface AssetListParams {
121
127
  */
122
128
  includeUploadUrl?: boolean;
123
129
 
130
+ /**
131
+ * Filters assets by kind.
132
+ */
133
+ kindFilter?: AssetKind;
134
+
124
135
  /**
125
136
  * Maximum number of items to be returned. The default is 50.
126
137
  */
@@ -160,6 +171,10 @@ export interface AssetGetParams {
160
171
  export interface AssetGetOrCreateParams {
161
172
  name: string;
162
173
 
174
+ kind?: AssetKind;
175
+
176
+ platform?: AssetPlatform;
177
+
163
178
  /**
164
179
  * Optional time-to-live as a Go duration string (e.g. "24h"). When set, the asset
165
180
  * is deleted this long after now; minimum is 1m. Omit for no expiry. On re-upload
@@ -169,9 +184,15 @@ export interface AssetGetOrCreateParams {
169
184
  ttl?: string;
170
185
  }
171
186
 
187
+ export type AssetKind = 'App' | 'Keychain';
188
+
189
+ export type AssetPlatform = 'ios' | 'android' | 'xcode';
190
+
172
191
  export declare namespace Assets {
173
192
  export {
174
193
  type Asset as Asset,
194
+ type AssetKind as AssetKind,
195
+ type AssetPlatform as AssetPlatform,
175
196
  type AssetListResponse as AssetListResponse,
176
197
  type AssetGetOrCreateResponse as AssetGetOrCreateResponse,
177
198
  type AssetListParams as AssetListParams,
@@ -16,6 +16,8 @@ export {
16
16
  } from './android-instances';
17
17
  export {
18
18
  type Asset,
19
+ type AssetKind,
20
+ type AssetPlatform,
19
21
  type AssetListResponse,
20
22
  type AssetGetOrCreateResponse,
21
23
  type AssetListParams,
@@ -208,7 +208,7 @@ export namespace IosInstanceCreateParams {
208
208
  }
209
209
 
210
210
  export interface InitialAsset {
211
- kind: 'App';
211
+ kind: 'App' | 'Keychain';
212
212
 
213
213
  source: 'URL' | 'AssetName' | 'AssetID';
214
214
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.36.0'; // x-release-please-version
1
+ export const VERSION = '0.36.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.36.0";
1
+ export declare const VERSION = "0.36.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.36.0";
1
+ export declare const VERSION = "0.36.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.0'; // x-release-please-version
4
+ exports.VERSION = '0.36.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.0'; // x-release-please-version
1
+ export const VERSION = '0.36.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map