export type UpdateApiAppPackagesAppPkgIdPackageContentArgs = {body: BodyInit}; export type UpdateApiAppPackagesAppPkgIdPackageContentOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Uploads the content of application package. * * PUT /app_packages/{appPkgId}/package_content */ export const updateApiAppPackagesAppPkgIdPackageContent = async (args: UpdateApiAppPackagesAppPkgIdPackageContentArgs, options?: UpdateApiAppPackagesAppPkgIdPackageContentOptions) => { const {baseUrl = "https://localhost/app_pkgm/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/zip") const url = `${baseUrl.replace(/\/+$/, '')}/app_packages/${encodeURIComponent(String(args.appPkgId))}/package_content${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };