export type CreateApiAssetPacksAssetPackIdAssetsIdFilesArgs = {assetPackId: string, id: string, body: BodyInit}; export type CreateApiAssetPacksAssetPackIdAssetsIdFilesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Upload asset files * * POST /assetPacks/{assetPackId}/assets/{id}/files */ export const createApiAssetPacksAssetPackIdAssetsIdFiles = async (args: CreateApiAssetPacksAssetPackIdAssetsIdFilesArgs, options?: CreateApiAssetPacksAssetPackIdAssetsIdFilesOptions) => { const {baseUrl = "https://realm-provider.decentraland.org", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/assetPacks/${encodeURIComponent(String(args.assetPackId))}/assets/${encodeURIComponent(String(args.id))}/files${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };