export type GetApiProjectsUuidEnvironmentsEnvironmentNameOrUuidEnvsArgs = {uuid: string, environment_name_or_uuid: string}; export type GetApiProjectsUuidEnvironmentsEnvironmentNameOrUuidEnvsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List Environment Shared Envs * * GET /projects/{uuid}/environments/{environment_name_or_uuid}/envs */ export const getApiProjectsUuidEnvironmentsEnvironmentNameOrUuidEnvs = async (args: GetApiProjectsUuidEnvironmentsEnvironmentNameOrUuidEnvsArgs, options?: GetApiProjectsUuidEnvironmentsEnvironmentNameOrUuidEnvsOptions) => { const {baseUrl = "https://app.coolify.io/api/v1", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.uuid))}/environments/${encodeURIComponent(String(args.environment_name_or_uuid))}/envs${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 };