UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

31 lines (30 loc) 887 B
import { allowNotFoundError as l } from "../../../synapse-client/SynapseClientUtils.js"; import { convertToEntityType as c, entityTypeToFriendlyName as s } from "../../functions/EntityTypeUtils.js"; async function d(i, n, o, r) { const t = (await l( () => o.entityServicesClient.postRepoV1EntityChild({ entityLookupRequest: { parentId: n, entityName: i } }) ))?.id ?? null; if (t == null) return t; const e = await o.entityServicesClient.getRepoV1EntityId({ id: t }); if (e.concreteType != "org.sagebionetworks.repo.model.FileEntity") { const y = c(e.concreteType); throw new Error( `A(n) ${s( y )} named "${i}" already exists in this location (${n}).${r ? ` ${r}` : ""}` ); } return e.id; } export { d as getFileEntityIdWithSameName }; //# sourceMappingURL=getFileEntityIdWithSameName.js.map