Skip to content

Commit

Permalink
Added Swagger UI and Dependencies Bumped (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamputraintan authored Jan 19, 2024
1 parent 53370d5 commit c7692de
Show file tree
Hide file tree
Showing 15 changed files with 1,937 additions and 1,227 deletions.
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

0 comments on commit c7692de

Please sign in to comment.