-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
2,809 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# For more configuration details: | ||
# https://docs.codecov.io/docs/codecov-yaml | ||
|
||
# Check if this file is valid by running in bash: | ||
# curl -X POST --data-binary @.codecov.yml https://codecov.io/validate | ||
|
||
# Coverage configuration | ||
# ---------------------- | ||
coverage: | ||
status: | ||
patch: false | ||
|
||
range: 70..90 # First number represents red, and second represents green | ||
# (default is 70..100) | ||
round: down # up, down, or nearest | ||
precision: 2 # Number of decimal places, between 0 and 5 | ||
|
||
# Ignoring Paths | ||
# -------------- | ||
# which folders/files to ignore | ||
|
||
# Pull request comments: | ||
# ---------------------- | ||
# Diff is the Coverage Diff of the pull request. | ||
# Files are the files impacted by the pull request | ||
comment: | ||
layout: diff, files # accepted in any order: reach, diff, flags, and/or files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { describe, it, expect } from 'vitest' | ||
|
||
import { API_BASE_PREFIX, API_PROXY_BASE_PREFIX } from '../common' | ||
import { API_BASE_PREFIX_ANNONARS, API_BASE_PREFIX_MEHARI } from '../common' | ||
|
||
describe('constants', () => { | ||
it('returns the correct proxy API base prefix in production mode', () => { | ||
describe('API_BASE_PREFIX constants', () => { | ||
it('returns the correct API base prefix for annonars in production mode', () => { | ||
const originalMode = import.meta.env.MODE | ||
expect(API_BASE_PREFIX).toBe('/') | ||
expect(API_BASE_PREFIX_ANNONARS).toBe('/proxy/annonars') | ||
import.meta.env.MODE = originalMode | ||
}) | ||
|
||
it('returns the correct proxy API base prefix in production mode', () => { | ||
it('returns the correct API base prefix for mehari in production mode', () => { | ||
const originalMode = import.meta.env.MODE | ||
expect(API_PROXY_BASE_PREFIX).toBe('/proxy/') | ||
expect(API_BASE_PREFIX_MEHARI).toBe('/proxy/mehari') | ||
import.meta.env.MODE = originalMode | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export const API_BASE_PREFIX = import.meta.env.MODE == 'development' ? '//localhost:8080/' : '/' | ||
export const API_BASE_PREFIX_ANNONARS = | ||
import.meta.env.MODE == 'development' ? '//localhost:8080/proxy/annonars' : '/proxy/annonars' | ||
|
||
export const API_PROXY_BASE_PREFIX = `${API_BASE_PREFIX}proxy/` | ||
export const API_BASE_PREFIX_MEHARI = | ||
import.meta.env.MODE == 'development' ? '//localhost:8080/proxy/mehari' : '/proxy/mehari' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { API_BASE_PREFIX_MEHARI } from '@/api/common' | ||
|
||
const API_BASE_URL = `${API_BASE_PREFIX_MEHARI}/` | ||
|
||
export class MehariClient { | ||
private apiBaseUrl: string | ||
private csrfToken: string | null | ||
|
||
constructor(apiBaseUrl?: string, csrfToken?: string) { | ||
this.apiBaseUrl = apiBaseUrl ?? API_BASE_URL | ||
this.csrfToken = csrfToken ?? null | ||
} | ||
|
||
async retrieveTxCsq( | ||
genomeRelease: string, | ||
chromosome: string, | ||
pos: number, | ||
reference: string, | ||
alternative: string, | ||
hgnc_id?: string | ||
): Promise<any> { | ||
const hgncSuffix = hgnc_id ? `&hgnc-id=${hgnc_id}` : '' | ||
const url = | ||
`${this.apiBaseUrl}tx/csq?genome-release=${genomeRelease}&` + | ||
`chromosome=${chromosome}&position=${pos}&reference=${reference}&` + | ||
`alternative=${alternative}${hgncSuffix}` | ||
|
||
const response = await fetch(url, { | ||
method: 'GET' | ||
}) | ||
return await response.json() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.