-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add method to create a resource (#115)
* feature (resource): add method to create a resource * feature (resource): create a resource with a custom timestamp * feature (resource): update a resource's metadata * feature (resource): delete a resource * test (resource): create a resource * test (resource): update a resource's metadata * test (resource): delete a resource * test (resource): delete a resource * feature (resource): add e2e tests * feature (v2 test data): sync with Knora * feature (v2 test data): use generated v2 test data * feature (v2 test data): use generated v2 test data for lists * feature (v2 test data): use generated v2 test data for all onto metadata * feature (v2 test data): use generated v2 test data for testding * feature (v2 test data): use generated v2 test data for page * feature (v2 test data): use generated v2 test data for search * refactor (package.json): rewrite admin integration script in JS * feature (resource): use generated v2 test data * feature (resource): use generated v2 test data * feature (resource): use generated v2 test data * test (resource): add test data for resource preview * test (resource): add test data for resource preview * test (resource): add test data for resource update * test (resource): add test data for resource update and deletion * test (resource): do not use expanded jsonld test data for responses * test (resource): add more tests * test (resource): dates in test data
- Loading branch information
1 parent
df166a7
commit 56171d3
Showing
68 changed files
with
1,622 additions
and
12,790 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict"; | ||
|
||
const fs = require('fs-extra'); | ||
|
||
let pathToGeneratedCode; | ||
|
||
// expect three args | ||
if (process.argv.length !== 3) { | ||
console.error("Usage: npm run integrate-admin-code <generated client code>"); | ||
process.exit(1); | ||
} else { | ||
pathToGeneratedCode = process.argv[2]; | ||
if (!fs.existsSync(pathToGeneratedCode)) { | ||
console.error("Specified path to generated client code is not valid"); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
fs.copySync(pathToGeneratedCode + "/api/admin", "./src/api/admin"); | ||
fs.copySync(pathToGeneratedCode + "/models/admin", "./src/models/admin"); | ||
fs.copySync(pathToGeneratedCode + "/test-data/admin", "./test/data/api/admin"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,27 @@ | ||
"use strict"; | ||
|
||
const fs = require('fs'); | ||
const fs = require('fs-extra'); | ||
const testDataConfig = require("./v2-test-data-config.json"); | ||
|
||
let pathToKnora; | ||
let pathToGeneratedCode; | ||
|
||
// expect three args | ||
if (process.argv.length !== 4) { | ||
console.error("Usage: npm run integrate-vs-test-data <Knora project root> <generated client code>"); | ||
if (process.argv.length !== 3) { | ||
console.error("Usage: npm run integrate-v2-test-data <generated client code>"); | ||
process.exit(1); | ||
} else { | ||
pathToKnora = process.argv[2]; | ||
if (!fs.existsSync(pathToKnora)) { | ||
console.error("Specified path to Knora is not valid"); | ||
process.exit(1); | ||
} | ||
pathToGeneratedCode = process.argv[3]; | ||
pathToGeneratedCode = process.argv[2]; | ||
if (!fs.existsSync(pathToGeneratedCode)) { | ||
console.error("Specified path to generated client code is not valid"); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
// copy static test data | ||
for (const file of testDataConfig["static-test-data"]) { | ||
const src = pathToKnora + file["source"]; | ||
const dest = file["destination"]; | ||
|
||
fs.copyFileSync(src, dest); | ||
} | ||
|
||
// copy generated test data | ||
for (const file of testDataConfig["generated-test-data"]) { | ||
const src = pathToGeneratedCode + file["source"]; | ||
const dest = file["destination"]; | ||
|
||
fs.copyFileSync(src, dest); | ||
fs.copySync(src, dest); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.