Skip to content

Commit

Permalink
Merge branch 'add-vocabs-route'
Browse files Browse the repository at this point in the history
See PR #32
  • Loading branch information
Nick Stokoe committed Oct 28, 2024
2 parents ab1d574 + adee06d commit 18638be
Show file tree
Hide file tree
Showing 22 changed files with 1,173 additions and 380 deletions.
12 changes: 12 additions & 0 deletions apps/back-end/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ export function MykomapRouter(
return reply;
},

async getConfig({ params: { datasetId }, request, reply }) {
// Validate the parameters some more

if (!sendJson(request, reply, filePath("datasets", datasetId, "config")))
throw new TsRestResponseError(contract.getDataset, {
status: 404,
body: { message: `unknown datasetId '${datasetId}'` },
});

return reply;
},

async getVersion(req) {
return {
body: __BUILD_INFO__,
Expand Down
156 changes: 0 additions & 156 deletions apps/back-end/test/data/config/dataset-A/config.json

This file was deleted.

17 changes: 0 additions & 17 deletions apps/back-end/test/data/datasets/dataset-A/initiatives/0.json

This file was deleted.

17 changes: 0 additions & 17 deletions apps/back-end/test/data/datasets/dataset-A/initiatives/1.json

This file was deleted.

4 changes: 0 additions & 4 deletions apps/back-end/test/data/datasets/dataset-A/locations.json

This file was deleted.

16 changes: 0 additions & 16 deletions apps/back-end/test/data/datasets/dataset-A/searchable.json

This file was deleted.

1 change: 1 addition & 0 deletions apps/back-end/test/data/datasets/test-A.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[[1,2],[3,2],[5,2],["a",3]]
30 changes: 30 additions & 0 deletions apps/back-end/test/data/datasets/test-A/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"prefixes": {
"https://dev.lod.coop/essglobal/2.1/standard/activities-modified/": "am"
},
"vocabs": {
"am": {
"en": {
"title": "Activities (Modified)",
"terms": {
"AM10": "Arts, Media, Culture & Leisure",
"AM20": "Campaigning, Activism & Advocacy",
"AM30": "Community & Collective Spaces",
"AM40": "Education",
"AM50": "Energy",
"AM60": "Food",
"AM70": "Goods & Services",
"AM80": "Health, Social Care & Wellbeing",
"AM90": "Housing",
"AM100": "Money & Finance",
"AM110": "Nature, Conservation & Environment",
"AM120": "Reduce, Reuse, Repair & Recycle",
"AM130": "Agriculture",
"AM140": "Industry",
"AM150": "Utilities",
"AM160": "Transport"
}
}
}
}
}
1 change: 1 addition & 0 deletions apps/back-end/test/data/datasets/test-A/items/0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":0, "a":"a:foo", "b":"b:bar", "desc": "humbug"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[2]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1]
44 changes: 0 additions & 44 deletions apps/back-end/test/validation.test.ts

This file was deleted.

6 changes: 4 additions & 2 deletions libs/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
"prebuild": "npm run generate-openapi",
"build": "vite build",
"generate-openapi": "npx vite-node src/api/generate-openapi.ts",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "vitest run"
},
"dependencies": {
"@ts-rest/core": "^3.51.0",
"@ts-rest/open-api": "^3.51.0",
"glob": "^11.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
Expand All @@ -26,6 +27,7 @@
"typescript": "^5.5.4",
"vite": "^5.4.3",
"vite-node": "^2.0.5",
"vite-plugin-dts": "^4.1.0"
"vite-plugin-dts": "^4.1.0",
"vitest": "^2.1.4"
}
}
Loading

0 comments on commit 18638be

Please sign in to comment.