Skip to content
Open
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# dmptool-api Changelog

## 2026-06-15
- Updated dependencies
- Added overrides for shell-quote and esbuild
- Removed old overrides for ws and brace-expansion

## 2026-05-26
- Added validation for `POST /dmps` to reject payloads containing more than one `dmp.project` with a `dmp_invalid` error
- Added models and workflows to map `dmp.project[0].funding` plus DMP Tool extensions (`funding_opportunity` and `funding_project`) to `ProjectFunding` and `PlanFunding`
Expand Down
439 changes: 417 additions & 22 deletions docs/jsonSamples/full-dmp-tool-v1_2.json

Large diffs are not rendered by default.

4,075 changes: 1,418 additions & 2,657 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,43 @@
"prepare": "husky"
},
"overrides": {
"brace-expansion": "5.0.6",
"ws": "8.20.1"
"@babel/core": "8.0.1",
"js-yaml": "5.1.0",
"ws": "8.21.0"
},
"dependencies": {
"@apollo/client": "^4.1.9",
"@dmptool/types": "^3.1.5",
"@dmptool/utils": "^2.1.1",
"@apollo/client": "^4.2.3",
"@dmptool/types": "^3.1.7",
"@dmptool/utils": "^2.1.4",
"@fastify/accept-negotiator": "^2.0.1",
"@fastify/cookie": "^11.0.2",
"@fastify/error": "^4.2.0",
"@fastify/jwt": "^10.1.0",
"@fastify/rate-limit": "^10.3.0",
"@fastify/rate-limit": "^11.0.0",
"@fastify/routes": "^6.0.2",
"@fastify/swagger": "^9.7.0",
"@fastify/swagger-ui": "^5.2.6",
"@fastify/swagger-ui": "^6.0.0",
"dotenv": "^17.4.2",
"fastify": "^5.8.5",
"fastify-cli": "^8.0.0",
"graphql": "^16.14.0"
"graphql": "^16.14.2",
"zod": "^4.4.3"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@graphql-codegen/cli": "^7.0.0",
"@types/node": "^25.9.1",
"@graphql-codegen/cli": "^7.1.3",
"@types/node": "^16.0.0",
"babel-jest": "^30.4.1",
"eslint": "^10.4.0",
"eslint": "^10.5.0",
"husky": "^9.1.7",
"jest": "^30.4.2",
"jest-expect-message": "^1.1.3",
"pino-pretty": "^13.1.3",
"ts-jest": "^29.4.10",
"ts-jest": "^29.4.11",
"ts-node": "^10.9.2",
"tsx": "^4.22.3",
"tsx": "^4.22.4",
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.4"
"typescript-eslint": "^8.62.0"
},
"optionalDependencies": {
"@esbuild/linux-arm64": "latest"
Expand Down
18 changes: 15 additions & 3 deletions src/generated/gql.ts

Large diffs are not rendered by default.

89 changes: 59 additions & 30 deletions src/generated/graphql.ts

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions src/graphql/mutation/answer.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
mutation AddAnswer($planId: Int!, $versionedSectionId: Int, $versionedQuestionId: Int, $versionedCustomSectionId: Int, $versionedCustomQuestionId: Int, $json: String) {
addAnswer(planId: $planId, versionedSectionId: $versionedSectionId, versionedQuestionId: $versionedQuestionId, versionedCustomSectionId: $versionedCustomSectionId, versionedCustomQuestionId: $versionedCustomQuestionId, json: $json) {
id
json
errors {
json
planId
versionedSectionId
versionedQuestionId
}
}
}

mutation UpdateAnswer($answerId: Int!, $json: String) {
updateAnswer(answerId: $answerId, json: $json) {
id
json
errors {
json
}
}
}
2 changes: 2 additions & 0 deletions src/graphql/mutation/plan.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mutation UpdatePlanStatus($planId: Int!, $status: PlanStatus!) {
status
}
id
dmpId
modified
modifiedById
status
Expand All @@ -35,6 +36,7 @@ mutation UpdatePlanTitle($planId: Int!, $title: String!) {
title
}
id
dmpId
modified
modifiedById
title
Expand Down
7 changes: 7 additions & 0 deletions src/graphql/query/answer.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

query AnswerForQuestion($projectId: Int!, $planId: Int!, $versionedQuestionId: Int!, $versionedCustomQuestionId: Int) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The answerByVersionedQuestionId query in Apollo Server doesn't have the GraphQL argument projectId

answerByVersionedQuestionId(projectId: $projectId, planId: $planId, versionedQuestionId: $versionedQuestionId, versionedCustomQuestionId: $versionedCustomQuestionId) {
id
json
}
}
40 changes: 40 additions & 0 deletions src/graphql/query/versionedTemplate.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ query VersionedTemplates($templateId: Int!) {
template {
id
}
versionedSections {
id
section {
id
}
name
displayOrder
tags {
id
slug
}
versionedQuestions {
id
questionId
versionedSectionId
questionText
displayOrder
json
}
}
}
}

Expand All @@ -19,5 +39,25 @@ query DefaultTemplate {
template {
id
}
versionedSections {
id
section {
id
}
name
displayOrder
tags {
id
slug
}
versionedQuestions {
id
questionId
versionedSectionId
questionText
displayOrder
json
}
}
}
}
2 changes: 1 addition & 1 deletion src/models/Affiliation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Affiliation extends BaseGraphQLModel {
mutation: AddAffiliationDocument,
variables: {
input: {
name: this.name,
displayName: this.name,
funder: this.funder ?? false,
active: true
}
Expand Down
Loading