Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Swagger UI and Dependencies Bumped #83

Merged
merged 10 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/workload/stateless/metadata_manager/src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ dist

dbschema/edgeql-js
dbschema/queries.*
dbschema/queriesZodSchema.ts
dbschema/interfaces.ts

asset/
14 changes: 10 additions & 4 deletions lib/workload/stateless/metadata_manager/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ stop:
# Build the app for deployment

edgetypes:
@npx generate queries --target ts --file --dsn edgedb://orcabus_admin:admin@$(EDGEDB_HOST):5656 --tls-security insecure # pragma: allowlist secret
@npx generate edgeql-js --target ts --output-dir dbschema/edgeql-js --dsn edgedb://orcabus_admin:admin@$(EDGEDB_HOST):5656 --tls-security insecure # pragma: allowlist secret
@npx generate interfaces --file dbschema/interfaces.ts --dsn edgedb://orcabus_admin:admin@$(EDGEDB_HOST):5656 --tls-security insecure # pragma: allowlist secret
@yarn run -B generate queries --target ts --file --dsn edgedb://orcabus_admin:admin@$(EDGEDB_HOST):5656 --tls-security insecure # pragma: allowlist secret
@yarn run -B generate edgeql-js --target ts --output-dir dbschema/edgeql-js --dsn edgedb://orcabus_admin:admin@$(EDGEDB_HOST):5656 --tls-security insecure # pragma: allowlist secret
@yarn run -B generate interfaces --file dbschema/interfaces.ts --dsn edgedb://orcabus_admin:admin@$(EDGEDB_HOST):5656 --tls-security insecure # pragma: allowlist secret
@yarn run ts-to-zod dbschema/queries.ts dbschema/queriesZodSchema.ts


build: edgetypes
@rm -rf asset
Expand All @@ -32,7 +34,6 @@ build: edgetypes
@zip -r asset/dependency.zip nodejs
@rm -rf nodejs


# Testing
test:
@yarn test
Expand All @@ -44,6 +45,11 @@ start-scenario-1: edgetypes
@yarn run insert-scenario-1
@yarn start

# Start in watch mode
watch: edgetypes
@yarn run insert-scenario-1
@yarn watch

# Inserting scenarios
insert-scenario-2:
@yarn run insert-scenario-2
Expand Down
4 changes: 3 additions & 1 deletion lib/workload/stateless/metadata_manager/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ http://localhost:8080/subject
http://localhost:8080/library
http://localhost:8080/specimen

# Swagger Endpoint
http://localhost:8080/documentation

<!-- GraphQL -->
# GraphQL Endpoint
http://localhost:8080/graphql/explore (UI)
http://localhost:8080/graphql (Only for graphql POST method)
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ filter .id = <uuid>$auditDbId
set
{
actionOutcome := <ActionOutcome>$actionOutcome,
details := <json>$details,
details := <optional json>$details,
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
select metadata::Library{
*

with

# Pagination parameter
offset_ := <optional int16>$offset ?? 0,
limit_ := <optional int16>$limit ?? 10,

libraries := (
select metadata::Library {
*
}
filter (
.orcaBusId ?= <optional str>$orcaBusId ?? .orcaBusId
AND
.internalId ?= <optional str>$internalId ?? .internalId
AND
.externalId ?= <optional str>$externalId ?? .externalId
AND
.phenotype ?= <optional str>$phenotype ?? .phenotype
AND
.assay ?= <optional str>$assay ?? .assay
AND
.coverage ?= <optional str>$coverage ?? .coverage
AND
.quality ?= <optional str>$quality ?? .quality
AND
.type ?= <optional str>$type ?? .type
AND
.workflow = <optional metadata::WorkflowTypes>$workflow ?? .workflow
)
)
select {

results := (
select libraries {
*
}
offset offset_
limit limit_
),
pagination := {
total := count(libraries),
`offset` := offset_,
`limit` := limit_
}

}

Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
select metadata::Specimen{
*
with

# Pagination parameter
offset_ := <optional int16>$offset ?? 0,
limit_ := <optional int16>$limit ?? 10,

libraries := (
select metadata::Specimen {
*
}
filter (
.orcaBusId ?= <optional str>$orcaBusId ?? .orcaBusId
AND
.internalId ?= <optional str>$internalId ?? .internalId
AND
.externalId ?= <optional str>$externalId ?? .externalId
AND
.source ?= <optional str>$source ?? .source
)
)
select {

results := (
select libraries {
*
}
offset offset_
limit limit_
),
pagination := {
total := count(libraries),
`offset` := offset_,
`limit` := limit_
}

}

Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
select metadata::Subject{
*
with

# Pagination parameter
offset_ := <optional int16>$offset ?? 0,
limit_ := <optional int16>$limit ?? 10,

libraries := (
select metadata::Subject {
*
}
filter (
.orcaBusId ?= <optional str>$orcaBusId ?? .orcaBusId
AND
.internalId ?= <optional str>$internalId ?? .internalId
AND
.externalId ?= <optional str>$externalId ?? .externalId
)
)
select {

results := (
select libraries {
*
}
offset offset_
limit limit_
),
pagination := {
total := count(libraries),
`offset` := offset_,
`limit` := limit_
}
}

Loading