@sjcrh/proteinpaint-types 2.138.3-4 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/dataset.ts +19 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-types",
3
- "version": "2.138.3-4",
3
+ "version": "2.138.3-5",
4
4
  "type": "module",
5
5
  "description": "Shared type definitions between ProteinPaint server and client code",
6
6
  "main": "src/index.ts",
package/src/dataset.ts CHANGED
@@ -1380,14 +1380,29 @@ export type Termdb = {
1380
1380
  /** Terms */
1381
1381
  termIds?: TermIds
1382
1382
  /**
1383
- * The required minimum number of samples with data as queried with getData() or other code,
1383
+ * Check for the required minimum number of samples with data as queried with getData() or other code,
1384
1384
  * in order to minimize the ease of extracting identifiable information from aggregate data
1385
1385
  * in server response
1386
1386
  *
1387
- * sampleCount: the number of samples with matching data from one or more queried terms
1388
- * q : req.query as processed through app middleware (pre-parsed, may have req.body props, __protectec__, etc)
1387
+ * q : req.query as processed through app middleware (pre-parsed, may have req.body props, __protectec__, etc)
1388
+ *
1389
+ * data{
1390
+ * sampleCount: the number of samples with matching data from one or more queried terms
1391
+ * }
1392
+ *
1393
+ * returns: {minSampleSize, canAccess}, see below
1389
1394
  */
1390
- hasMinSampleSize?: (sampleCount: number, q: any) => boolean
1395
+ checkAccessToSampleData?: (
1396
+ q: any,
1397
+ data: { sampleCount: number }
1398
+ ) => {
1399
+ /** the required minimum sample size for the current user,
1400
+ * may be dependent on login status or other context
1401
+ * */
1402
+ minSampleSize: number
1403
+ /** whether downstreadm backend code can proceed */
1404
+ canAccess: boolean
1405
+ }
1391
1406
  /** if true, backend is allowed to send sample names to client in charts */
1392
1407
  displaySampleIds?: (clientAuthResult: any) => boolean
1393
1408
  converSampleIds?: boolean