export type GetApiSearchDbTicketsCheckInUidPatternArgs = {uid_pattern: number}; export type GetApiSearchDbTicketsCheckInUidPatternOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Search tickets by UID pattern for check-in * * GET /search_db/tickets_check_in/{uid_pattern} */ export const getApiSearchDbTicketsCheckInUidPattern = async (args: GetApiSearchDbTicketsCheckInUidPatternArgs, options?: GetApiSearchDbTicketsCheckInUidPatternOptions) => { const {baseUrl = "http://api.gostarmartbus.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/search_db/tickets_check_in/${encodeURIComponent(String(args.uid_pattern))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };