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

54 lines (53 loc) 1.95 kB
import "../../utils/PermissionLevelToAccessType.js"; import "../../utils/SynapseConstants.js"; import "react"; import "../../synapse-client/SynapseClient.js"; import "@sage-bionetworks/synapse-client/generated/models/ErrorResponseCode"; import "@sage-bionetworks/synapse-client/generated/models/TwoFactorAuthErrorResponse"; import "@sage-bionetworks/synapse-client/util/SynapseClientError"; import "@sage-bionetworks/synapse-types"; import "../../utils/functions/EntityTypeUtils.js"; import "lodash-es"; import "@sage-bionetworks/synapse-client/util/synapseClientFetch"; import { useSynapseContext as e } from "../../utils/context/SynapseContext.js"; import "use-deep-compare-effect"; import { useQuery as a } from "@tanstack/react-query"; import "@tanstack/query-core"; import "lodash-es/isEmpty"; import "lodash-es/isEqual"; import "lodash-es/xorWith"; import "@mui/material"; import "@sage-bionetworks/synapse-client"; import "../../utils/types/IsType.js"; import "react/jsx-runtime"; import "../../utils/hooks/useCookiePreferences.js"; import "../../utils/hooks/useSourceAppConfigs.js"; import "universal-cookie"; import "../../utils/AppUtils/session/ApplicationSessionContext.js"; import "../../utils/context/FullContextProvider.js"; import "../../utils/context/DocumentMetadataContext.js"; import '../../style/components/_spinner.css';/* empty css */ import "react-router"; const n = "https://api.github.com/repos"; function S(o, r, p) { const { keyFactory: m } = e(), s = async () => { const t = await fetch( `${n}/${o}/${r}/tags` ); if (!t.ok) throw new Error(`Error fetching tags: ${t.statusText}`); const i = await t.json(); if (i.length === 0) throw new Error("No tags found."); return i[0].name; }; return a({ ...p, queryKey: m.getGithubLatestTagKey(o, r), queryFn: s }); } export { S as useLatestTag }; //# sourceMappingURL=useGithub.js.map