export type GetApiAppPackagesAppPkgIdPackageContentOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Fetch the onboarded application package content identified by appPkgId or appDId. * * GET /app_packages/{appPkgId}/package_content */ export const getApiAppPackagesAppPkgIdPackageContent = async (options?: GetApiAppPackagesAppPkgIdPackageContentOptions) => { const {baseUrl = "https://localhost/app_pkgm/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/app_packages/${encodeURIComponent(String(args.appPkgId))}/package_content${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 };