Skip to content

Commit

Permalink
adding remaining api methods via openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 committed Oct 6, 2024
1 parent 4c9a8fc commit f23c33d
Show file tree
Hide file tree
Showing 75 changed files with 2,299 additions and 234 deletions.
4 changes: 2 additions & 2 deletions apps/agora/api/src/components/biodomains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// -------------------------------------------------------------------------- //
import { Request, Response, NextFunction } from 'express';
import { cache, setHeaders } from '../helpers';
import { AllBioDomainsCollection, BioDomains, BioDomainsCollection } from '../models';
import { BioDomainInfo } from '../../app/models';
import { AllBioDomainsCollection, BioDomainsCollection } from '../models';
import { BioDomains, BioDomainInfo } from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Functions
Expand Down
13 changes: 8 additions & 5 deletions apps/agora/api/src/components/comparison.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ import {
Gene,
GCTGene,
GCTGeneNominations,
RnaDifferentialExpression,
RnaDifferentialExpressionCollection,
ProteinDifferentialExpression,
ProteomicsLFQCollection,
ProteomicsTMTCollection,
Team,
ProteomicsSRMCollection,
} from '../models';
import { BioDomains, TargetNomination, Scores } from '../../app/models';

import {
BioDomains,
ProteinDifferentialExpression,
RnaDifferentialExpression,
TargetNomination,
Team,
} from '@sagebionetworks/agora/api-client-angular';
import { Scores } from 'libs/agora/models';
// -------------------------------------------------------------------------- //
// Functions
// -------------------------------------------------------------------------- //
Expand Down
15 changes: 11 additions & 4 deletions apps/agora/api/src/components/distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ import {
ProteomicDistributionCollection,
OverallScoresDistributionCollection,
} from '../models';
import {
RnaDistribution,
Distribution,
OverallScores,
OverallScoresDistribution,
ProteomicsDistribution,
} from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Functions
// -------------------------------------------------------------------------- //

export async function getRnaDistribution() {
const cacheKey = 'rna-distribution';
let result = cache.get(cacheKey);
let result: RnaDistribution[] | undefined = cache.get(cacheKey);

if (result) {
return result;
Expand All @@ -33,7 +40,7 @@ export async function getRnaDistribution() {

export async function getProteomicDistribution(type: string) {
const cacheKey = 'proteomics-' + type + '-distribution';
let result = cache.get(cacheKey);
let result: ProteomicsDistribution[] | undefined = cache.get(cacheKey);

if (result) {
return result;
Expand All @@ -47,7 +54,7 @@ export async function getProteomicDistribution(type: string) {

export async function getOverallScoresDistribution() {
const cacheKey = 'overall-scores-distribution';
let result: any = cache.get(cacheKey);
let result: OverallScoresDistribution[] | undefined = cache.get(cacheKey);

if (result) {
return result;
Expand All @@ -66,7 +73,7 @@ export async function getOverallScoresDistribution() {

export async function getDistribution() {
const cacheKey = 'distribution';
let result: any = cache.get(cacheKey);
let result: Distribution | undefined = cache.get(cacheKey);

if (result) {
return result;
Expand Down
3 changes: 2 additions & 1 deletion apps/agora/api/src/components/experimental-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Internal
// -------------------------------------------------------------------------- //
import { cache } from '../helpers';
import { ExperimentalValidation, ExperimentalValidationCollection } from '../models';
import { ExperimentalValidationCollection } from '../models';
import { ExperimentalValidation } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Functions
Expand Down
3 changes: 2 additions & 1 deletion apps/agora/api/src/components/metabolomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Internal
// -------------------------------------------------------------------------- //
import { cache } from '../helpers';
import { Metabolomics, MetabolomicsCollection } from '../models';
import { MetabolomicsCollection } from '../models';
import { Metabolomics } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Internal
// -------------------------------------------------------------------------- //
import { cache } from '../helpers';
import { NeuropathologicCorrelation, NeuropathologicCorrelationCollection } from '../models';
import { NeuropathologicCorrelationCollection } from '../models';
import { NeuropathologicCorrelation } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Functions
Expand Down
3 changes: 2 additions & 1 deletion apps/agora/api/src/components/overall-scores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Internal
// -------------------------------------------------------------------------- //
import { cache } from '../helpers';
import { OverallScores, OverallScoresCollection } from '../models';
import { OverallScoresCollection } from '../models';
import { OverallScores } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Functions
Expand Down
2 changes: 1 addition & 1 deletion apps/agora/api/src/components/proteomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// -------------------------------------------------------------------------- //
import { cache } from '../helpers';
import {
ProteinDifferentialExpression,
ProteomicsLFQCollection,
ProteomicsSRMCollection,
ProteomicsTMTCollection,
} from '../models';
import { ProteinDifferentialExpression } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Functions
Expand Down
5 changes: 2 additions & 3 deletions apps/agora/api/src/components/rna.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// Internal
// -------------------------------------------------------------------------- //
import { cache } from '../helpers';

import { RnaDifferentialExpression, RnaDifferentialExpressionCollection } from '../models';

import { RnaDifferentialExpressionCollection } from '../models';
import { RnaDifferentialExpression } from 'libs/agora/models';
// -------------------------------------------------------------------------- //
// Functions
// -------------------------------------------------------------------------- //
Expand Down
3 changes: 2 additions & 1 deletion apps/agora/api/src/components/scores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Internal
// -------------------------------------------------------------------------- //
import { cache } from '../helpers';
import { Scores, ScoresCollection } from '../models';
import { ScoresCollection } from '../models';
import { Scores } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Functions
Expand Down
13 changes: 1 addition & 12 deletions apps/agora/api/src/models/biodomains.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
// -------------------------------------------------------------------------- //
// External
// -------------------------------------------------------------------------- //
import { Schema, model } from 'mongoose';
import { BioDomains, BioDomain, BioDomainInfo } from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { BioDomains, BioDomain, BioDomainInfo } from '../../app/models';
export { BioDomains, BioDomain } from '../../app/models';

// -------------------------------------------------------------------------- //
// Schemas
// -------------------------------------------------------------------------- //
const BioDomainSchema = new Schema<BioDomain>({
biodomain: { type: String, required: true },
go_terms: { type: [String], required: true },
Expand Down
6 changes: 5 additions & 1 deletion apps/agora/api/src/models/comparison.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
// Internal
// -------------------------------------------------------------------------- //

export { GCTGene, GCTGeneTissue, GCTGeneNominations } from '../../app/models';
export {
GCTGene,
GCTGeneTissue,
GCTGeneNominations,
} from '@sagebionetworks/agora/api-client-angular';
2 changes: 1 addition & 1 deletion apps/agora/api/src/models/dataversion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dataversion } from '@sagebionetworks/agora/api-client-angular';
import { Schema, model } from 'mongoose';
import { Dataversion } from '@sagebionetworks/agora/api-client-angular';

const DataVersionSchema = new Schema<Dataversion>(
{
Expand Down
11 changes: 3 additions & 8 deletions apps/agora/api/src/models/distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ import {
RnaDistribution,
OverallScoresDistribution,
ProteomicsDistribution,
} from '../../app/models';
export {
RnaDistribution,
OverallScoresDistribution,
ProteomicsDistribution,
} from '../../app/models';
} from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Schemas
Expand All @@ -34,14 +29,14 @@ const RnaDistributionSchema = new Schema<RnaDistribution>(
{ collection: 'rnaboxdistribution' },
);

const ProteomicDistributionSchema = new Schema(
const ProteomicDistributionSchema = new Schema<ProteomicsDistribution>(
{
type: String,
},
{ collection: 'proteomicsboxdistribution' },
);

const OverallScoresDistributionSchema = new Schema(
const OverallScoresDistributionSchema = new Schema<OverallScoresDistribution>(
{
distribution: [{ type: Number, required: true }],
bins: [[{ type: Number, required: true }]],
Expand Down
13 changes: 1 addition & 12 deletions apps/agora/api/src/models/experimental-validation.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
// -------------------------------------------------------------------------- //
// External
// -------------------------------------------------------------------------- //
import { Schema, model } from 'mongoose';
import { ExperimentalValidation } from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { ExperimentalValidation } from '../../app/models';
export { ExperimentalValidation } from '../../app/models';

// -------------------------------------------------------------------------- //
// Schemas
// -------------------------------------------------------------------------- //
const ExperimentalValidationSchema = new Schema<ExperimentalValidation>(
{
_id: { type: String, required: true },
Expand Down
16 changes: 1 addition & 15 deletions apps/agora/api/src/models/gene-links.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
// -------------------------------------------------------------------------- //
// External
// -------------------------------------------------------------------------- //
import { Schema, model } from 'mongoose';
import { GeneNetworkLinks } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { GeneNetworkLinks } from '../../app/models';
export { GeneNetworkLinks } from '../../app/models';

// -------------------------------------------------------------------------- //
// Schemas
// -------------------------------------------------------------------------- //
const GeneLinkSchema = new Schema<GeneNetworkLinks>(
{
geneA_ensembl_gene_id: { type: String, required: true },
Expand All @@ -23,7 +12,4 @@ const GeneLinkSchema = new Schema<GeneNetworkLinks>(
{ collection: 'geneslinks' },
);

// -------------------------------------------------------------------------- //
// Models
// -------------------------------------------------------------------------- //
export const GeneLinkCollection = model<GeneNetworkLinks>('GeneLinksCollection', GeneLinkSchema);
6 changes: 3 additions & 3 deletions apps/agora/api/src/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './dataversion';
export * from './biodomains';
export * from './comparison';
export * from './dataversion';
export * from './distribution';
export * from './experimental-validation';
export * from './gene-links';
Expand All @@ -9,6 +10,5 @@ export * from './neuropathologic-correlations';
export * from './overall-scores';
export * from './proteomics';
export * from './rna';
export * from './teams';
export * from './scores';
export * from './biodomains';
export * from './teams';
3 changes: 1 addition & 2 deletions apps/agora/api/src/models/metabolomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Schema, model } from 'mongoose';
// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { Metabolomics } from '../../app/models';
export { Metabolomics } from '../../app/models';
import { Metabolomics } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Schemas
Expand Down
3 changes: 1 addition & 2 deletions apps/agora/api/src/models/neuropathologic-correlations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Schema, model } from 'mongoose';
// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { NeuropathologicCorrelation } from '../../app/models';
export { NeuropathologicCorrelation } from '../../app/models';
import { NeuropathologicCorrelation } from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Schemas
Expand Down
6 changes: 4 additions & 2 deletions apps/agora/api/src/models/overall-scores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { Schema, model } from 'mongoose';
// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { OverallScores } from '../../app/models';
export { OverallScores, OverallScoresDistribution } from '../../app/models';
import {
OverallScores,
OverallScoresDistribution,
} from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Schemas
Expand Down
3 changes: 1 addition & 2 deletions apps/agora/api/src/models/proteomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Schema, model } from 'mongoose';
// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { ProteinDifferentialExpression } from '../../app/models';
export { ProteinDifferentialExpression } from '../../app/models';
import { ProteinDifferentialExpression } from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Schemas
Expand Down
3 changes: 1 addition & 2 deletions apps/agora/api/src/models/rna.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Schema, model } from 'mongoose';
// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { RnaDifferentialExpression } from '../../app/models';
export { RnaDifferentialExpression } from '../../app/models';
import { RnaDifferentialExpression } from '@sagebionetworks/agora/api-client-angular';

// -------------------------------------------------------------------------- //
// Schemas
Expand Down
3 changes: 1 addition & 2 deletions apps/agora/api/src/models/scores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Schema, model } from 'mongoose';
// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { Scores } from '../../app/models';
export { Scores } from '../../app/models';
import { Scores } from 'libs/agora/models';

// -------------------------------------------------------------------------- //
// Schemas
Expand Down
Loading

0 comments on commit f23c33d

Please sign in to comment.