@ebowwa/ios-devices 1.0.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/dist/device-ctl.d.ts +128 -0
- package/dist/device-ctl.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5365 -0
- package/dist/index.js.map +22 -0
- package/dist/lib-imobiledevice.d.ts +162 -0
- package/dist/lib-imobiledevice.d.ts.map +1 -0
- package/dist/sim-ctl.d.ts +216 -0
- package/dist/sim-ctl.d.ts.map +1 -0
- package/dist/types.d.ts +487 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/unified-api.d.ts +122 -0
- package/dist/unified-api.d.ts.map +1 -0
- package/dist/utils.d.ts +47 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +49 -0
- package/src/device-ctl.ts +547 -0
- package/src/index.ts +8 -0
- package/src/lib-imobiledevice.ts +404 -0
- package/src/shell-quote.d.ts +5 -0
- package/src/sim-ctl.ts +502 -0
- package/src/types.ts +315 -0
- package/src/unified-api.ts +578 -0
- package/src/utils.ts +174 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ebowwa/ios-devices - Type definitions
|
|
3
|
+
* iOS device control types for devicectl, libimobiledevice, and simctl
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Device Types
|
|
10
|
+
// ============================================================================
|
|
11
|
+
|
|
12
|
+
export const IOSDeviceSchema = z.object({
|
|
13
|
+
identifier: z.string(), // UDID
|
|
14
|
+
name: z.string(),
|
|
15
|
+
model: z.string(),
|
|
16
|
+
modelCode: z.string(),
|
|
17
|
+
productType: z.string(),
|
|
18
|
+
osVersion: z.string(),
|
|
19
|
+
osBuildVersion: z.string(),
|
|
20
|
+
architecture: z.string(),
|
|
21
|
+
platform: z.enum(['iOS', 'iPadOS', 'tvOS', 'watchOS', 'visionOS']),
|
|
22
|
+
connectionType: z.enum(['USB', 'Network', 'Wireless']),
|
|
23
|
+
isTrusted: z.boolean(),
|
|
24
|
+
isAvailable: z.boolean(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type IOSDevice = z.infer<typeof IOSDeviceSchema>;
|
|
28
|
+
|
|
29
|
+
export const DeviceDetailsSchema = z.object({
|
|
30
|
+
udid: z.string(),
|
|
31
|
+
name: z.string(),
|
|
32
|
+
model: z.string(),
|
|
33
|
+
productType: z.string(),
|
|
34
|
+
productVersion: z.string(),
|
|
35
|
+
buildVersion: z.string(),
|
|
36
|
+
serialNumber: z.string().optional(),
|
|
37
|
+
cpuArchitecture: z.string(),
|
|
38
|
+
deviceName: z.string(),
|
|
39
|
+
timeZone: z.string().optional(),
|
|
40
|
+
locale: z.string().optional(),
|
|
41
|
+
totalDiskSpace: z.number().optional(),
|
|
42
|
+
freeDiskSpace: z.number().optional(),
|
|
43
|
+
batteryLevel: z.number().optional(),
|
|
44
|
+
batteryState: z.enum(['unplugged', 'charging', 'full']).optional(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export type DeviceDetails = z.infer<typeof DeviceDetailsSchema>;
|
|
48
|
+
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Process Types
|
|
51
|
+
// ============================================================================
|
|
52
|
+
|
|
53
|
+
export const ProcessInfoSchema = z.object({
|
|
54
|
+
pid: z.number(),
|
|
55
|
+
name: z.string(),
|
|
56
|
+
user: z.string().optional(),
|
|
57
|
+
cpuPercent: z.number().optional(),
|
|
58
|
+
memoryMB: z.number().optional(),
|
|
59
|
+
startTime: z.number().optional(),
|
|
60
|
+
bundleIdentifier: z.string().optional(),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export type ProcessInfo = z.infer<typeof ProcessInfoSchema>;
|
|
64
|
+
|
|
65
|
+
export const ProcessSignalSchema = z.enum([
|
|
66
|
+
'SIGTERM',
|
|
67
|
+
'SIGKILL',
|
|
68
|
+
'SIGHUP',
|
|
69
|
+
'SIGINT',
|
|
70
|
+
'SIGSTOP',
|
|
71
|
+
'SIGCONT',
|
|
72
|
+
'SIGUSR1',
|
|
73
|
+
'SIGUSR2',
|
|
74
|
+
]);
|
|
75
|
+
|
|
76
|
+
export type ProcessSignal = z.infer<typeof ProcessSignalSchema>;
|
|
77
|
+
|
|
78
|
+
// ============================================================================
|
|
79
|
+
// App Types
|
|
80
|
+
// ============================================================================
|
|
81
|
+
|
|
82
|
+
export const InstalledAppSchema = z.object({
|
|
83
|
+
bundleIdentifier: z.string(),
|
|
84
|
+
bundleName: z.string(),
|
|
85
|
+
bundleVersion: z.string(),
|
|
86
|
+
shortVersion: z.string().optional(),
|
|
87
|
+
installPath: z.string(),
|
|
88
|
+
dataContainerPath: z.string().optional(),
|
|
89
|
+
executableName: z.string().optional(),
|
|
90
|
+
platform: z.enum(['iOS', 'iPadOS', 'tvOS', 'watchOS', 'visionOS', 'macOS']),
|
|
91
|
+
type: z.enum(['User', 'System', 'Internal']),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export type InstalledApp = z.infer<typeof InstalledAppSchema>;
|
|
95
|
+
|
|
96
|
+
export const AppInstallResultSchema = z.object({
|
|
97
|
+
success: z.boolean(),
|
|
98
|
+
bundleIdentifier: z.string().optional(),
|
|
99
|
+
error: z.string().optional(),
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export type AppInstallResult = z.infer<typeof AppInstallResultSchema>;
|
|
103
|
+
|
|
104
|
+
// ============================================================================
|
|
105
|
+
// Logging Types
|
|
106
|
+
// ============================================================================
|
|
107
|
+
|
|
108
|
+
export const LogEntrySchema = z.object({
|
|
109
|
+
timestamp: z.string(),
|
|
110
|
+
process: z.string(),
|
|
111
|
+
pid: z.number().optional(),
|
|
112
|
+
level: z.enum(['debug', 'info', 'notice', 'warning', 'error', 'fault']).optional(),
|
|
113
|
+
message: z.string(),
|
|
114
|
+
subsystem: z.string().optional(),
|
|
115
|
+
category: z.string().optional(),
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export type LogEntry = z.infer<typeof LogEntrySchema>;
|
|
119
|
+
|
|
120
|
+
export const LogFilterSchema = z.object({
|
|
121
|
+
match: z.string().optional(),
|
|
122
|
+
unmatch: z.string().optional(),
|
|
123
|
+
process: z.string().optional(),
|
|
124
|
+
exclude: z.string().optional(),
|
|
125
|
+
kernel: z.boolean().optional(),
|
|
126
|
+
trigger: z.string().optional(),
|
|
127
|
+
untrigger: z.string().optional(),
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export type LogFilter = z.infer<typeof LogFilterSchema>;
|
|
131
|
+
|
|
132
|
+
// ============================================================================
|
|
133
|
+
// File System Types
|
|
134
|
+
// ============================================================================
|
|
135
|
+
|
|
136
|
+
export const FileInfoSchema = z.object({
|
|
137
|
+
path: z.string(),
|
|
138
|
+
name: z.string(),
|
|
139
|
+
isDirectory: z.boolean(),
|
|
140
|
+
size: z.number().optional(),
|
|
141
|
+
modifiedTime: z.number().optional(),
|
|
142
|
+
createdTime: z.number().optional(),
|
|
143
|
+
permissions: z.string().optional(),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export type FileInfo = z.infer<typeof FileInfoSchema>;
|
|
147
|
+
|
|
148
|
+
export const FileCopyOptionsSchema = z.object({
|
|
149
|
+
source: z.string(),
|
|
150
|
+
destination: z.string(),
|
|
151
|
+
overwrite: z.boolean().optional().default(false),
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export type FileCopyOptions = z.infer<typeof FileCopyOptionsSchema>;
|
|
155
|
+
|
|
156
|
+
// ============================================================================
|
|
157
|
+
// Diagnostics Types
|
|
158
|
+
// ============================================================================
|
|
159
|
+
|
|
160
|
+
export const DiagnosticsTypeSchema = z.enum([
|
|
161
|
+
'All',
|
|
162
|
+
'WiFi',
|
|
163
|
+
'GasGauge',
|
|
164
|
+
'NAND',
|
|
165
|
+
'Battery',
|
|
166
|
+
'HDMI',
|
|
167
|
+
]);
|
|
168
|
+
|
|
169
|
+
export type DiagnosticsType = z.infer<typeof DiagnosticsTypeSchema>;
|
|
170
|
+
|
|
171
|
+
export interface IOKitEntry {
|
|
172
|
+
name: string;
|
|
173
|
+
path: string;
|
|
174
|
+
properties?: Record<string, unknown>;
|
|
175
|
+
children?: IOKitEntry[];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export const IOKitEntrySchema: z.ZodType<IOKitEntry> = z.object({
|
|
179
|
+
name: z.string(),
|
|
180
|
+
path: z.string(),
|
|
181
|
+
properties: z.record(z.unknown()).optional(),
|
|
182
|
+
children: z.array(z.lazy(() => IOKitEntrySchema)).optional(),
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// ============================================================================
|
|
186
|
+
// Backup Types
|
|
187
|
+
// ============================================================================
|
|
188
|
+
|
|
189
|
+
export const BackupInfoSchema = z.object({
|
|
190
|
+
snapshotId: z.string(),
|
|
191
|
+
deviceName: z.string(),
|
|
192
|
+
deviceType: z.string(),
|
|
193
|
+
iOSVersion: z.string(),
|
|
194
|
+
buildVersion: z.string(),
|
|
195
|
+
date: z.string(),
|
|
196
|
+
size: z.number().optional(),
|
|
197
|
+
isEncrypted: z.boolean().optional(),
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
export type BackupInfo = z.infer<typeof BackupInfoSchema>;
|
|
201
|
+
|
|
202
|
+
// ============================================================================
|
|
203
|
+
// Simulator Types
|
|
204
|
+
// ============================================================================
|
|
205
|
+
|
|
206
|
+
export const SimulatorDeviceSchema = z.object({
|
|
207
|
+
udid: z.string(),
|
|
208
|
+
name: z.string(),
|
|
209
|
+
state: z.enum(['Shutdown', 'Booted', 'Shutting Down']),
|
|
210
|
+
runtime: z.string(),
|
|
211
|
+
deviceType: z.string(),
|
|
212
|
+
availability: z.enum(['available', 'unavailable']),
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
export type SimulatorDevice = z.infer<typeof SimulatorDeviceSchema>;
|
|
216
|
+
|
|
217
|
+
export const SimulatorRuntimeSchema = z.object({
|
|
218
|
+
identifier: z.string(),
|
|
219
|
+
name: z.string(),
|
|
220
|
+
version: z.string(),
|
|
221
|
+
buildVersion: z.string(),
|
|
222
|
+
isAvailable: z.boolean(),
|
|
223
|
+
platform: z.string(),
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
export type SimulatorRuntime = z.infer<typeof SimulatorRuntimeSchema>;
|
|
227
|
+
|
|
228
|
+
export const SimulatorDeviceTypeSchema = z.object({
|
|
229
|
+
identifier: z.string(),
|
|
230
|
+
name: z.string(),
|
|
231
|
+
productFamily: z.string(),
|
|
232
|
+
minRuntimeVersion: z.string().optional(),
|
|
233
|
+
maxRuntimeVersion: z.string().optional(),
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
export type SimulatorDeviceType = z.infer<typeof SimulatorDeviceTypeSchema>;
|
|
237
|
+
|
|
238
|
+
// ============================================================================
|
|
239
|
+
// Display Types
|
|
240
|
+
// ============================================================================
|
|
241
|
+
|
|
242
|
+
export const DisplayInfoSchema = z.object({
|
|
243
|
+
id: z.number(),
|
|
244
|
+
width: z.number(),
|
|
245
|
+
height: z.number(),
|
|
246
|
+
scale: z.number(),
|
|
247
|
+
refreshRate: z.number().optional(),
|
|
248
|
+
colorSpace: z.string().optional(),
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
export type DisplayInfo = z.infer<typeof DisplayInfoSchema>;
|
|
252
|
+
|
|
253
|
+
// ============================================================================
|
|
254
|
+
// Location Types
|
|
255
|
+
// ============================================================================
|
|
256
|
+
|
|
257
|
+
export const LocationSchema = z.object({
|
|
258
|
+
latitude: z.number(),
|
|
259
|
+
longitude: z.number(),
|
|
260
|
+
altitude: z.number().optional(),
|
|
261
|
+
horizontalAccuracy: z.number().optional(),
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
export type Location = z.infer<typeof LocationSchema>;
|
|
265
|
+
|
|
266
|
+
// ============================================================================
|
|
267
|
+
// Provisioning Profile Types
|
|
268
|
+
// ============================================================================
|
|
269
|
+
|
|
270
|
+
export const ProvisioningProfileSchema = z.object({
|
|
271
|
+
uuid: z.string(),
|
|
272
|
+
name: z.string(),
|
|
273
|
+
teamName: z.string(),
|
|
274
|
+
teamIdentifier: z.string(),
|
|
275
|
+
platform: z.string(),
|
|
276
|
+
expirationDate: z.string(),
|
|
277
|
+
creationDate: z.string(),
|
|
278
|
+
appIds: z.array(z.string()),
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
export type ProvisioningProfile = z.infer<typeof ProvisioningProfileSchema>;
|
|
282
|
+
|
|
283
|
+
// ============================================================================
|
|
284
|
+
// Command Execution Types
|
|
285
|
+
// ============================================================================
|
|
286
|
+
|
|
287
|
+
export const CommandResultSchema = z.object({
|
|
288
|
+
success: z.boolean(),
|
|
289
|
+
stdout: z.string(),
|
|
290
|
+
stderr: z.string(),
|
|
291
|
+
exitCode: z.number(),
|
|
292
|
+
json: z.unknown().optional(),
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
export type CommandResult = z.infer<typeof CommandResultSchema>;
|
|
296
|
+
|
|
297
|
+
export const DeviceIdentifierSchema = z.union([
|
|
298
|
+
z.string(), // UDID, name, or ECID
|
|
299
|
+
z.object({ udid: z.string() }),
|
|
300
|
+
z.object({ name: z.string() }),
|
|
301
|
+
z.object({ ecid: z.string() }),
|
|
302
|
+
]);
|
|
303
|
+
|
|
304
|
+
export type DeviceIdentifier = z.infer<typeof DeviceIdentifierSchema>;
|
|
305
|
+
|
|
306
|
+
// ============================================================================
|
|
307
|
+
// Notification Types
|
|
308
|
+
// ============================================================================
|
|
309
|
+
|
|
310
|
+
export const DarwinNotificationSchema = z.object({
|
|
311
|
+
name: z.string(),
|
|
312
|
+
userInfo: z.record(z.unknown()).optional(),
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
export type DarwinNotification = z.infer<typeof DarwinNotificationSchema>;
|