export type GetApiV1TimeclocksFacilityFacilityCodeTimeclockIdArgs = {facilityCode: string, timeclockId: string}; export type GetApiV1TimeclocksFacilityFacilityCodeTimeclockIdOptions = {baseUrl: string, https?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Get timeclock entry details by ID * * GET /v1/timeclocks/facility/{facilityCode}/{timeclockId} */ export const getApiV1TimeclocksFacilityFacilityCodeTimeclockId = async (args: GetApiV1TimeclocksFacilityFacilityCodeTimeclockIdArgs, options: GetApiV1TimeclocksFacilityFacilityCodeTimeclockIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, https} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (https !== undefined) headers.set('authorization', `Basic ${btoa(`${https.username}:${https.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/timeclocks/facility/${encodeURIComponent(String(args.facilityCode))}/${encodeURIComponent(String(args.timeclockId))}${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 };