export type DeleteApiCollectionsCollectionIdItemsFeatureIdArgs = {collectionId: string, featureId: string}; export type DeleteApiCollectionsCollectionIdItemsFeatureIdOptions = {baseUrl?: string | undefined, JWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Feature * * DELETE /collections/{collectionId}/items/{featureId} * * Also accepts auth: BasicAuth */ export const deleteApiCollectionsCollectionIdItemsFeatureId = async (args: DeleteApiCollectionsCollectionIdItemsFeatureIdArgs, options?: DeleteApiCollectionsCollectionIdItemsFeatureIdOptions) => { const {baseUrl = "https://api.planet.com/features/v1/ogc/my", fetch: fetchFn = fetch, JWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWT !== undefined) headers.set('authorization', `Bearer ${JWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/collections/${encodeURIComponent(String(args.collectionId))}/items/${encodeURIComponent(String(args.featureId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };