export type CompleteChecklistItemDto = {notes?: string | undefined, fileName?: string | undefined, fileType?: string | undefined, fileData?: string | undefined, s3Key?: string | undefined}; export type CreateApiV1OffboardingChecklistMemberMemberIdItemTemplateItemIdCompleteArgs = {memberId: string, templateItemId: string, body: CompleteChecklistItemDto}; export type CreateApiV1OffboardingChecklistMemberMemberIdItemTemplateItemIdCompleteOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Complete an offboarding checklist item * * POST /v1/offboarding-checklist/member/{memberId}/item/{templateItemId}/complete */ export const createApiV1OffboardingChecklistMemberMemberIdItemTemplateItemIdComplete = async (args: CreateApiV1OffboardingChecklistMemberMemberIdItemTemplateItemIdCompleteArgs, options?: CreateApiV1OffboardingChecklistMemberMemberIdItemTemplateItemIdCompleteOptions) => { const {baseUrl = "https://api.trycomp.ai", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apikey !== undefined) headers.set("X-API-Key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/offboarding-checklist/member/${encodeURIComponent(String(args.memberId))}/item/${encodeURIComponent(String(args.templateItemId))}/complete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };