@limrun/api 0.75.0 → 0.76.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 (78) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/client.d.mts +1 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -0
  9. package/client.mjs.map +1 -1
  10. package/exec-client.d.mts +2 -0
  11. package/exec-client.d.mts.map +1 -1
  12. package/exec-client.d.ts +2 -0
  13. package/exec-client.d.ts.map +1 -1
  14. package/exec-client.js.map +1 -1
  15. package/exec-client.mjs.map +1 -1
  16. package/folder-sync.d.mts.map +1 -1
  17. package/folder-sync.d.ts.map +1 -1
  18. package/folder-sync.js +91 -62
  19. package/folder-sync.js.map +1 -1
  20. package/folder-sync.mjs +91 -62
  21. package/folder-sync.mjs.map +1 -1
  22. package/index.d.mts +1 -0
  23. package/index.d.mts.map +1 -1
  24. package/index.d.ts +1 -0
  25. package/index.d.ts.map +1 -1
  26. package/index.js +4 -2
  27. package/index.js.map +1 -1
  28. package/index.mjs +1 -0
  29. package/index.mjs.map +1 -1
  30. package/ios-client.d.mts +57 -3
  31. package/ios-client.d.mts.map +1 -1
  32. package/ios-client.d.ts +57 -3
  33. package/ios-client.d.ts.map +1 -1
  34. package/ios-client.js +21 -0
  35. package/ios-client.js.map +1 -1
  36. package/ios-client.mjs +21 -0
  37. package/ios-client.mjs.map +1 -1
  38. package/package.json +1 -1
  39. package/resources/index.d.mts +1 -0
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +1 -0
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +3 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +1 -0
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/ios-instances.d.mts +5 -4
  48. package/resources/ios-instances.d.mts.map +1 -1
  49. package/resources/ios-instances.d.ts +5 -4
  50. package/resources/ios-instances.d.ts.map +1 -1
  51. package/resources/support-tickets.d.mts +21 -0
  52. package/resources/support-tickets.d.mts.map +1 -0
  53. package/resources/support-tickets.d.ts +21 -0
  54. package/resources/support-tickets.d.ts.map +1 -0
  55. package/resources/support-tickets.js +19 -0
  56. package/resources/support-tickets.js.map +1 -0
  57. package/resources/support-tickets.mjs +15 -0
  58. package/resources/support-tickets.mjs.map +1 -0
  59. package/resources/xcode-instances-helpers.d.mts +2 -0
  60. package/resources/xcode-instances-helpers.d.mts.map +1 -1
  61. package/resources/xcode-instances-helpers.d.ts +2 -0
  62. package/resources/xcode-instances-helpers.d.ts.map +1 -1
  63. package/resources/xcode-instances-helpers.js.map +1 -1
  64. package/resources/xcode-instances-helpers.mjs.map +1 -1
  65. package/src/client.ts +1 -0
  66. package/src/exec-client.ts +2 -0
  67. package/src/folder-sync.ts +95 -68
  68. package/src/index.ts +5 -0
  69. package/src/ios-client.ts +119 -5
  70. package/src/resources/index.ts +1 -0
  71. package/src/resources/ios-instances.ts +13 -4
  72. package/src/resources/support-tickets.ts +36 -0
  73. package/src/resources/xcode-instances-helpers.ts +2 -0
  74. package/src/version.ts +1 -1
  75. package/version.d.mts +1 -1
  76. package/version.d.ts +1 -1
  77. package/version.js +1 -1
  78. package/version.mjs +1 -1
package/src/ios-client.ts CHANGED
@@ -675,7 +675,7 @@ export type PerformAction =
675
675
  }
676
676
  | { type: 'toggleKeyboard' }
677
677
  | { type: 'openUrl'; url: string }
678
- | { type: 'setOrientation'; orientation: 'Portrait' | 'Landscape' }
678
+ | { type: 'setOrientation'; orientation: DeviceOrientation }
679
679
  | { type: 'wait'; durationMs: number }
680
680
  | {
681
681
  type: 'touchDown';
@@ -713,7 +713,61 @@ export type PerformAction =
713
713
  | {
714
714
  type: 'buttonUp';
715
715
  button: 'home' | 'lock' | 'side' | 'applePay' | 'softwareKeyboard' | 'volumeUp' | 'volumeDown' | string;
716
- };
716
+ }
717
+ /**
718
+ * Press or release any HID usage by page and usage, such as page `0x0C`
719
+ * usage `0x6F` for Brightness Increment. Page `7` usages are keyboard keys.
720
+ * Simulators on Xcode before 27 accept only keyboard usages and the
721
+ * Consumer usages of the buttons above.
722
+ */
723
+ | { type: 'usageDown'; usagePage: number; usage: number }
724
+ | { type: 'usageUp'; usagePage: number; usage: number };
725
+
726
+ /**
727
+ * A device orientation. `deviceInfo` reports the same names in camelCase.
728
+ * `Landscape` is the older name of `LandscapeRight`.
729
+ */
730
+ export type DeviceOrientation =
731
+ | 'Portrait'
732
+ | 'PortraitUpsideDown'
733
+ | 'LandscapeLeft'
734
+ | 'LandscapeRight'
735
+ | 'Landscape';
736
+
737
+ /**
738
+ * A privacy service for {@link InstanceClient.setPermission}. Location goes
739
+ * through `simctl privacy` instead.
740
+ */
741
+ export type PrivacyService =
742
+ | 'calendar'
743
+ | 'camera'
744
+ | 'contacts'
745
+ | 'faceid'
746
+ | 'health'
747
+ | 'homekit'
748
+ | 'medialibrary'
749
+ | 'microphone'
750
+ | 'motion'
751
+ | 'notifications'
752
+ | 'photos'
753
+ | 'reminders'
754
+ | 'siri'
755
+ | 'speech'
756
+ | 'usertracking';
757
+
758
+ /**
759
+ * A privacy decision. `limited` applies only to `photos` and `critical`
760
+ * (critical alerts allowed too) only to `notifications`. `unset` removes the
761
+ * decision, so the app asks again.
762
+ */
763
+ export type PermissionStatus = 'granted' | 'denied' | 'limited' | 'critical' | 'unset';
764
+
765
+ /** System services {@link InstanceClient.restartServices} can restart. */
766
+ export type RestartableService =
767
+ | 'com.apple.SpringBoard'
768
+ | 'com.apple.locationd'
769
+ | 'com.apple.tccd'
770
+ | 'com.apple.akd';
717
771
 
718
772
  /**
719
773
  * Per-action result in a `performActions` batch. `type` identifies which
@@ -961,11 +1015,39 @@ export type InstanceClient = {
961
1015
  */
962
1016
  restoreKeychain: (options: { url: string }) => Promise<KeychainRestoreResult>;
963
1017
 
1018
+ /**
1019
+ * Wipe the simulator keychain. The CA certificates Limrun and you installed
1020
+ * are put back.
1021
+ */
1022
+ resetKeychain: () => Promise<void>;
1023
+
1024
+ /**
1025
+ * Set an app's privacy permission without a prompt. Setting `notifications`
1026
+ * restarts SpringBoard, which terminates every running app.
1027
+ */
1028
+ setPermission: (bundleId: string, service: PrivacyService, status: PermissionStatus) => Promise<void>;
1029
+
1030
+ /**
1031
+ * Read an app's privacy permission. `unset` means the app has not asked yet.
1032
+ * The `notifications` permission cannot be read.
1033
+ */
1034
+ getPermission: (
1035
+ bundleId: string,
1036
+ service: Exclude<PrivacyService, 'notifications'>,
1037
+ ) => Promise<PermissionStatus>;
1038
+
1039
+ /**
1040
+ * Restart system services, for example so system prompts pick up a new
1041
+ * language. Restarting SpringBoard terminates every running app; the call
1042
+ * returns once SpringBoard is back.
1043
+ */
1044
+ restartServices: (services: RestartableService[]) => Promise<void>;
1045
+
964
1046
  /**
965
1047
  * Set the device orientation
966
- * @param orientation The orientation to set ("Portrait" or "Landscape")
1048
+ * @param orientation The orientation to set
967
1049
  */
968
- setOrientation: (orientation: 'Portrait' | 'Landscape') => Promise<void>;
1050
+ setOrientation: (orientation: DeviceOrientation) => Promise<void>;
969
1051
  /** Returns null for a simulator without a hinge. */
970
1052
  getFoldState: () => Promise<FoldState | null>;
971
1053
  /** Capture an upright Duo display. A powered-off display returns its native black image. */
@@ -2333,6 +2415,10 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
2333
2415
  bundleId: msg.bundleId || '',
2334
2416
  }),
2335
2417
  keychainExportResult: () => undefined,
2418
+ resetKeychainResult: () => undefined,
2419
+ setPermissionResult: () => undefined,
2420
+ getPermissionResult: (msg) => (msg as unknown as { status: PermissionStatus }).status,
2421
+ restartServicesResult: () => undefined,
2336
2422
  keychainImportResult: (msg): KeychainRestoreResult => ({
2337
2423
  durationMs: msg.durationMs ?? 0,
2338
2424
  }),
@@ -2575,6 +2661,10 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
2575
2661
  installApp,
2576
2662
  saveKeychain,
2577
2663
  restoreKeychain,
2664
+ resetKeychain,
2665
+ setPermission,
2666
+ getPermission,
2667
+ restartServices,
2578
2668
  setOrientation,
2579
2669
  getFoldState,
2580
2670
  screenshotDisplay,
@@ -3032,10 +3122,34 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
3032
3122
  return sendRequest('setHingeAngle', { angleDegrees });
3033
3123
  };
3034
3124
 
3035
- const setOrientation = (orientation: 'Portrait' | 'Landscape'): Promise<void> => {
3125
+ const setOrientation = (orientation: DeviceOrientation): Promise<void> => {
3036
3126
  return sendRequest<void>('setOrientation', { orientation });
3037
3127
  };
3038
3128
 
3129
+ const resetKeychain = (): Promise<void> => {
3130
+ return sendRequest<void>('resetKeychain', {}, undefined, 120_000);
3131
+ };
3132
+
3133
+ const setPermission = (
3134
+ bundleId: string,
3135
+ service: PrivacyService,
3136
+ status: PermissionStatus,
3137
+ ): Promise<void> => {
3138
+ // A notifications change waits for SpringBoard to restart.
3139
+ return sendRequest<void>('setPermission', { bundleId, service, status }, undefined, 60_000);
3140
+ };
3141
+
3142
+ const getPermission = (
3143
+ bundleId: string,
3144
+ service: Exclude<PrivacyService, 'notifications'>,
3145
+ ): Promise<PermissionStatus> => {
3146
+ return sendRequest<PermissionStatus>('getPermission', { bundleId, service });
3147
+ };
3148
+
3149
+ const restartServices = (services: RestartableService[]): Promise<void> => {
3150
+ return sendRequest<void>('restartServices', { services }, undefined, 60_000);
3151
+ };
3152
+
3039
3153
  const scroll = (
3040
3154
  direction: 'up' | 'down' | 'left' | 'right',
3041
3155
  pixels: number,
@@ -11,6 +11,7 @@ export {
11
11
  type SnapshotListParams,
12
12
  } from './snapshots';
13
13
 
14
+ export { SupportTickets, type SupportTicket, type SupportTicketCreateParams } from './support-tickets';
14
15
  export {
15
16
  Analytics,
16
17
  type AnalyticsInstancesResponse,
@@ -260,11 +260,20 @@ export namespace IosInstanceCreateParams {
260
260
 
261
261
  /**
262
262
  * The Apple Simulator model. iphone-se is an iPhone SE (3rd generation) and
263
- * iphone-17e an iPhone 17e, for testing smaller screens. iPhone Duo requires
263
+ * iphone-17e an iPhone 17e, for testing smaller screens. For large App Store
264
+ * screenshots, choose iphone-16-pro-max or ipad-pro-13. iPhone Duo requires
264
265
  * Xcode 27.1. See the OSVersion clue for the iOS versions each model runs.
265
266
  * Default is iphone.
266
267
  */
267
- model?: 'iphone' | 'iphone-se' | 'iphone-17e' | 'iphone-duo' | 'ipad' | 'watch';
268
+ model?:
269
+ | 'iphone'
270
+ | 'iphone-se'
271
+ | 'iphone-17e'
272
+ | 'iphone-16-pro-max'
273
+ | 'ipad-pro-13'
274
+ | 'iphone-duo'
275
+ | 'ipad'
276
+ | 'watch';
268
277
 
269
278
  /**
270
279
  * Where the instance will be created. If not given, the region is decided based on
@@ -318,8 +327,8 @@ export namespace IosInstanceCreateParams {
318
327
 
319
328
  /**
320
329
  * The major version of iOS, "26" or "27". iphone and ipad run both; iphone-se,
321
- * iphone-17e and iphone-duo run 27; watch runs 26. Default is 26, or 27 on the
322
- * models that run only 27.
330
+ * iphone-17e, iphone-duo, iphone-16-pro-max and ipad-pro-13 run 27; watch runs 26.
331
+ * Default is 26, or 27 on the models that run only 27.
323
332
  */
324
333
  osVersion?: string;
325
334
  }
@@ -0,0 +1,36 @@
1
+ import { APIPromise } from '../core/api-promise';
2
+ import { APIResource } from '../core/resource';
3
+ import { buildHeaders } from '../internal/headers';
4
+ import { RequestOptions } from '../internal/request-options';
5
+ import { path } from '../internal/utils/path';
6
+ import { uuid4 } from '../internal/utils/uuid';
7
+
8
+ export interface SupportTicketCreateParams {
9
+ kind: 'ticket' | 'feedback';
10
+ subject: string;
11
+ message: string;
12
+ }
13
+
14
+ export interface SupportTicket {
15
+ id: string;
16
+ organizationId: string;
17
+ kind: string;
18
+ status: string;
19
+ subject: string;
20
+ createdAt: string;
21
+ }
22
+
23
+ export class SupportTickets extends APIResource {
24
+ /** Opens a ticket. Pass the same idempotencyKey when retrying the same event. */
25
+ create(
26
+ organizationId: string,
27
+ body: SupportTicketCreateParams,
28
+ options?: RequestOptions,
29
+ ): APIPromise<SupportTicket> {
30
+ return this._client.post(path`/v1/organizations/${organizationId}/support_tickets`, {
31
+ ...options,
32
+ body,
33
+ headers: buildHeaders([{ 'Idempotency-Key': options?.idempotencyKey ?? uuid4() }, options?.headers]),
34
+ });
35
+ }
36
+ }
@@ -125,6 +125,8 @@ export type XcodeProjectConfig = {
125
125
  * discovery picks the wrong bundle.
126
126
  */
127
127
  artifactName?: string;
128
+ /** Recompile from a clean build folder for this invocation. */
129
+ clean?: boolean;
128
130
  /**
129
131
  * xcodebuild action. 'build' (default) produces one .app; with a simulator
130
132
  * attached it is installed there. 'build-for-testing' compiles the scheme's
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.75.0'; // x-release-please-version
1
+ export const VERSION = '0.76.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.75.0";
1
+ export declare const VERSION = "0.76.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.75.0";
1
+ export declare const VERSION = "0.76.0";
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.75.0'; // x-release-please-version
4
+ exports.VERSION = '0.76.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.75.0'; // x-release-please-version
1
+ export const VERSION = '0.76.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map