export type ConditionCode = 'REGULAR_SHIFTS' | 'STANDBY_SHIFTS' | 'REPLACEMENTS' | 'UNFILLED_SHIFTS' | 'ASSIGNMENTS_TO_APPROVE' | 'REPLACEMENT_REQUESTS' | 'SWAP_REQUESTS' | 'REGULAR_SHIFTS_TO_APPROVE' | 'REPLACEMENTS_TO_APPROVE' | 'SWAPS_TO_APPROVE' | 'DRAFTS' | 'CANCELLED' | 'UNFILLED_SHIFTS_AND_DRAFT' | 'AUTO_SCHEDULED' | 'OPEN_EVENT_ASSIGNED' | 'EVENT_NOT_CONFIRMED' | 'RECURRENT_SHIFTS' | 'UNIQUE_SHIFTS'; export type PublishPublicEventsByPeriodRequest = {fromDate: string, toDate: string, forTeamIds?: Array | undefined, forTeamCodes?: Array | undefined, forMemberIds?: Array | undefined, forMemberCodes?: Array | undefined, forLocationIds?: Array | undefined, forLocationCodes?: Array | undefined, forSkillIds?: Array | undefined, forSkillCodes?: Array | undefined, forConditionCodes?: Array | undefined, sendNotification?: boolean | undefined}; export type CreateApiV1PublicEventsPublishPeriodArgs = {body: PublishPublicEventsByPeriodRequest}; export type CreateApiV1PublicEventsPublishPeriodOptions = {baseUrl?: string | undefined, basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Publish events occurring during a specific period of time. This operation runs asynchronously and will return immediately. * * POST /v1/public/events/publish/period */ export const createApiV1PublicEventsPublishPeriod = async (args: CreateApiV1PublicEventsPublishPeriodArgs, options?: CreateApiV1PublicEventsPublishPeriodOptions) => { const {baseUrl = "https://api.evolia.com", fetch: fetchFn = fetch, basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (basic !== undefined) headers.set('authorization', `Basic ${btoa(`${basic.username}:${basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/public/events/publish/period${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 };