Skip to content

Commit

Permalink
Merge branch 'master' into feature-custom-dataset-types
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrosx authored Dec 6, 2024
2 parents 508f947 + 335d319 commit cddf7f1
Show file tree
Hide file tree
Showing 17 changed files with 271 additions and 197 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ OIDC_USERQUERY_OPERATOR=<"or"|"and">
OIDC_USERQUERY_FILTER="username:username, email:email"

ELASTICSEARCH_ENABLED=<"yes"|"no">
APP_PORT=3003
STACK_VERSION="8.8.2"
CLUSTER_NAME="es-cluster"
MEM_LIMIT="4G"
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
IScientificFilter,
} from "./interfaces/common.interface";
import { ScientificRelation } from "./scientific-relation.enum";
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IFullFacets } from "src/elastic-search/interfaces/es-common.type";

// add Å to mathjs accepted units as equivalent to angstrom
const isAlphaOriginal = Unit.isValidAlpha;
Expand Down Expand Up @@ -1012,3 +1014,41 @@ const replaceLikeOperatorRecursive = (
export const sleep = (ms: number) => {
return new Promise((resolve) => setTimeout(resolve, ms));
};

export class FullFacetFilters {
@ApiPropertyOptional()
facets?: string;

@ApiPropertyOptional()
fields?: string;
}

export class FullQueryFilters {
@ApiPropertyOptional()
limits?: string;

@ApiPropertyOptional()
fields?: string;
}

class TotalSets {
@ApiProperty({ type: Number })
totalSets: number;
}

export class FullFacetResponse implements IFullFacets {
@ApiProperty({ type: TotalSets, isArray: true })
all: [TotalSets];

[key: string]: object;
}

export class CountApiResponse {
@ApiProperty({ type: Number })
count: number;
}

export class IsValidResponse {
@ApiProperty({ type: Boolean })
isvalid: boolean;
}
Loading

0 comments on commit cddf7f1

Please sign in to comment.