@sjcrh/proteinpaint-server 2.138.3-2 → 2.138.3-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,14 @@
1
1
  import termdbTestInit from "./termdb.test.js";
2
+ const minSampleSize = 10;
2
3
  function protected_test_default() {
3
4
  const ds = termdbTestInit();
4
5
  if (!ds.cohort)
5
6
  ds.cohort = { termdb: {} };
6
- ds.cohort.termdb.hasMinSampleSize = (sampleCount) => {
7
- return sampleCount >= 10;
7
+ ds.cohort.termdb.checkAccessToSampleData = (_, data) => {
8
+ return {
9
+ minSampleSize,
10
+ canAccess: data.sampleCount >= minSampleSize
11
+ };
8
12
  };
9
13
  return ds;
10
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-server",
3
- "version": "2.138.3-2",
3
+ "version": "2.138.3-5",
4
4
  "type": "module",
5
5
  "description": "a genomics visualization tool for exploring a cohort's genotype and phenotype data",
6
6
  "main": "src/app.js",
@@ -64,7 +64,7 @@
64
64
  "@sjcrh/proteinpaint-r": "2.137.2-0",
65
65
  "@sjcrh/proteinpaint-rust": "2.137.2-0",
66
66
  "@sjcrh/proteinpaint-shared": "2.137.3",
67
- "@sjcrh/proteinpaint-types": "2.138.3-2",
67
+ "@sjcrh/proteinpaint-types": "2.138.3-5",
68
68
  "@types/express": "^5.0.0",
69
69
  "@types/express-session": "^1.18.1",
70
70
  "better-sqlite3": "^9.4.1",
@@ -39,7 +39,7 @@ function init({ genomes }) {
39
39
  addProject(db.connection, query);
40
40
  res.status(200).send({
41
41
  status: "ok",
42
- message: `Project ${query.projectName} processed successfully`
42
+ message: `Project ${query.project.name} processed successfully`
43
43
  });
44
44
  } catch (e) {
45
45
  console.warn(e);
@@ -54,12 +54,12 @@ function editProject() {
54
54
  console.log(58, "called editProject");
55
55
  }
56
56
  function deleteProject(connection, query) {
57
- const sql = `DELETE FROM Project WHERE id= ?`;
57
+ const sql = `DELETE FROM project WHERE id= ?`;
58
58
  const params = [query.project.id];
59
59
  runSQL(connection, sql, params, "delete");
60
60
  }
61
61
  function addProject(connection, query) {
62
- const sql = `INSERT INTO Project (name) VALUES (?)`;
62
+ const sql = `INSERT INTO project (name) VALUES (?)`;
63
63
  const params = [query.project.name];
64
64
  runSQL(connection, sql, params, "add");
65
65
  }
@@ -35,7 +35,7 @@ function getProjects(ds) {
35
35
  if (!ds.queries?.WSImages?.db)
36
36
  return;
37
37
  const db = ds.queries.WSImages.db;
38
- const sql = "SELECT project.name as value, id FROM Project";
38
+ const sql = "SELECT project.name as value, id FROM project";
39
39
  try {
40
40
  db.connection = connect_db(db.file, { readonly: false, fileMustExist: true });
41
41
  const rows = db.connection.prepare(sql).all();
@@ -2,7 +2,7 @@ import { FilterTermValuesPayload } from "#types/checkers";
2
2
  import { getData, getSamplesPerFilter } from "../src/termdb.matrix.js";
3
3
  import { authApi } from "../src/auth.js";
4
4
  const api = {
5
- endpoint: "filterTermValues",
5
+ endpoint: "termdb/filterTermValues",
6
6
  methods: {
7
7
  get: {
8
8
  ...FilterTermValuesPayload,
@@ -1,7 +1,7 @@
1
1
  import { ProfileFormScoresPayload } from "#types/checkers";
2
2
  import { getData } from "../src/termdb.matrix.js";
3
3
  const api = {
4
- endpoint: "profileFormScores",
4
+ endpoint: "termdb/profileFormScores",
5
5
  methods: {
6
6
  get: {
7
7
  ...ProfileFormScoresPayload,
@@ -1,7 +1,7 @@
1
1
  import { ProfileScoresPayload } from "#types/checkers";
2
2
  import { getData } from "../src/termdb.matrix.js";
3
3
  const api = {
4
- endpoint: "profileScores",
4
+ endpoint: "termdb/profileScores",
5
5
  methods: {
6
6
  get: {
7
7
  ...ProfileScoresPayload,