-
Notifications
You must be signed in to change notification settings - Fork 18
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
25 changed files
with
328 additions
and
74 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
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import fpprg from '@/app/fpprg' | ||
import { z } from 'zod' | ||
import { Process } from '@/core/FPPRG' | ||
import handler from '@/utils/next-rest' | ||
import { NotFoundError, UnsupportedMethodError } from '@/spec/error' | ||
|
||
const QueryType = z.object({ | ||
fpl_id: z.string(), | ||
rebase_id: z.string(), | ||
}) | ||
|
||
export default handler(async (req, res) => { | ||
if (req.method !== 'POST') throw new UnsupportedMethodError(req.method) | ||
const { fpl_id, rebase_id } = QueryType.parse(req.query) | ||
const rebase = await fpprg.getFPL(rebase_id) | ||
if (rebase === undefined) throw new NotFoundError() | ||
const old_process = rebase.process | ||
const old_fpl = await fpprg.getFPL(fpl_id) | ||
if (old_fpl === undefined) throw new NotFoundError() | ||
if (old_process.timestamp !== undefined) { | ||
const new_process = await fpprg.upsertProcess(new Process( | ||
old_process.type, | ||
old_process.data, | ||
old_process.inputs, | ||
)) | ||
const { rebased, head } = old_fpl.rebase(old_process, new_process) | ||
const fpl = await fpprg.upsertFPL(head) | ||
res.status(200).json({ head: fpl.id, rebased: rebased.id }) | ||
} else { | ||
const resolved = await fpprg.getResolved(old_process.id) | ||
if (resolved === undefined) throw new NotFoundError() | ||
await fpprg.deleteResolved(resolved) | ||
res.status(200).json({ head: fpl_id, rebased: rebase_id }) | ||
} | ||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 +1,7 @@ | ||
{ | ||
"name": "limma_voom", | ||
"version": "1.0.0", | ||
"license": "CC-BY-4.0", | ||
"license": "GPL-2.0-or-later", | ||
"author": "Alex Agris <[email protected]>", | ||
"private": true, | ||
"dependencies": { | ||
|
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,7 +1,7 @@ | ||
{ | ||
"name": "pca-transformation", | ||
"version": "1.0.0", | ||
"license": "CC-BY-4.0", | ||
"license": "GPL-3.0-or-later", | ||
"author": "Juncheng Pan <[email protected]>", | ||
"private": true, | ||
"dependencies": { | ||
|
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.