(
udid: string,
options: {
levels?: string[];
limit?: number;
processes?: string[];
query?: string;
seconds?: number;
backfill?: boolean;
} = {},
)
| 99 | } |
| 100 | |
| 101 | export async function fetchSimulatorLogs( |
| 102 | udid: string, |
| 103 | options: { |
| 104 | levels?: string[]; |
| 105 | limit?: number; |
| 106 | processes?: string[]; |
| 107 | query?: string; |
| 108 | seconds?: number; |
| 109 | backfill?: boolean; |
| 110 | } = {}, |
| 111 | ): Promise<SimulatorLogsResponse> { |
| 112 | const params = new URLSearchParams(); |
| 113 | if (options.backfill) { |
| 114 | params.set("backfill", "true"); |
| 115 | } |
| 116 | if (options.seconds) { |
| 117 | params.set("seconds", String(options.seconds)); |
| 118 | } |
| 119 | if (options.limit) { |
| 120 | params.set("limit", String(options.limit)); |
| 121 | } |
| 122 | if (options.levels?.length) { |
| 123 | params.set("levels", options.levels.join(",")); |
| 124 | } |
| 125 | if (options.processes?.length) { |
| 126 | params.set("processes", options.processes.join(",")); |
| 127 | } |
| 128 | if (options.query?.trim()) { |
| 129 | params.set("q", options.query.trim()); |
| 130 | } |
| 131 | const query = params.size > 0 ? `?${params}` : ""; |
| 132 | return apiRequest<SimulatorLogsResponse>( |
| 133 | `/api/simulators/${udid}/logs${query}`, |
| 134 | ); |
| 135 | } |
| 136 | |
| 137 | export async function fetchSimulatorProcesses( |
| 138 | udid: string, |
no test coverage detected