Skip to content

Commit

Permalink
chore: Update dsp-api to v.30.7.0 (#610)
Browse files Browse the repository at this point in the history
* update api to v30.7.0

* update ProjectRestrictedViewSettings

* fix dates

* fix tests
  • Loading branch information
mpro7 authored Jan 26, 2024
1 parent 82debde commit 61e0566
Show file tree
Hide file tree
Showing 127 changed files with 146 additions and 144 deletions.
14 changes: 8 additions & 6 deletions src/api/admin/projects/projects-endpoint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ describe("ProjectsEndpoint", () => {
(response: ApiResponseData<ProjectRestrictedViewSettingsResponse>) => {

expect(response.body.settings.size).toEqual("!512,512");
expect(response.body.settings.watermark).toEqual("path_to_image");
expect(response.body.settings.watermark).toEqual(true);

done();
});
Expand All @@ -705,7 +705,7 @@ describe("ProjectsEndpoint", () => {
(response: ApiResponseData<ProjectRestrictedViewSettingsResponse>) => {

expect(response.body.settings.size).toEqual("!512,512");
expect(response.body.settings.watermark).toEqual("path_to_image");
expect(response.body.settings.watermark).toEqual(true);

done();
});
Expand All @@ -728,7 +728,7 @@ describe("ProjectsEndpoint", () => {
(response: ApiResponseData<ProjectRestrictedViewSettingsResponse>) => {

expect(response.body.settings.size).toEqual("!512,512");
expect(response.body.settings.watermark).toEqual("path_to_image");
expect(response.body.settings.watermark).toEqual(true);

done();
});
Expand All @@ -755,7 +755,7 @@ describe("ProjectsEndpoint", () => {
(response: ApiResponseData<ProjectRestrictedViewSettingsResponse>) => {

expect(response.body.settings.size).toEqual("!512,512");
expect(response.body.settings.watermark).toEqual("path_to_image");
expect(response.body.settings.watermark).toEqual(true);

done();
});
Expand All @@ -781,8 +781,10 @@ describe("ProjectsEndpoint", () => {
knoraApiConnection.admin.projectsEndpoint.getProjectRestrictedViewSettingByShortname("images").subscribe(
(response: ApiResponseData<ProjectRestrictedViewSettingsResponse>) => {

console.log(111111, response.body)

expect(response.body.settings.size).toEqual("!512,512");
expect(response.body.settings.watermark).toEqual("path_to_image");
expect(response.body.settings.watermark).toEqual(true);

done();
});
Expand All @@ -809,7 +811,7 @@ describe("ProjectsEndpoint", () => {
(response: ApiResponseData<ProjectRestrictedViewSettingsResponse>) => {

expect(response.body.settings.size).toEqual("!512,512");
expect(response.body.settings.watermark).toEqual("path_to_image");
expect(response.body.settings.watermark).toEqual(true);

done();
});
Expand Down
4 changes: 2 additions & 2 deletions src/api/v2/ontology/ontologies-endpoint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ describe("OntologiesEndpoint", () => {
deleteCardinalitiesFromClassRequest.id = "http://0.0.0.0:3333/ontology/0001/freetest/v2";

// update this timestamp after every release of dsp-api
deleteCardinalitiesFromClassRequest.lastModificationDate = "2023-12-08T08:25:48.331599046Z";
deleteCardinalitiesFromClassRequest.lastModificationDate = "2024-01-26T08:41:40.995149839Z";

const cardinalityToRemove = new UpdateResourceClassCardinality();

Expand Down Expand Up @@ -1265,7 +1265,7 @@ describe("OntologiesEndpoint", () => {
deleteCardinalitiesFromClassRequest.id = "http://0.0.0.0:3333/ontology/0001/freetest/v2";

// update this timestamp after every release of dsp-api
deleteCardinalitiesFromClassRequest.lastModificationDate = "2023-12-08T08:25:48.331599046Z";
deleteCardinalitiesFromClassRequest.lastModificationDate = "2024-01-26T08:41:40.995149839Z";

const cardinalityToRemove = new UpdateResourceClassCardinality();

Expand Down
8 changes: 4 additions & 4 deletions src/api/v2/resource/resources-endpoint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ describe("ResourcesEndpoint", () => {
expect(res.hasPermissions).toEqual("CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:ProjectMember");

// update this timestamp after every release of dsp-api
expect(res.lastModificationDate).toEqual("2023-12-09T08:22:49.722497472Z");
expect(res.lastModificationDate).toEqual("2024-01-27T08:38:44.745653920Z");
done();
}
);
Expand Down Expand Up @@ -550,7 +550,7 @@ describe("ResourcesEndpoint", () => {
updateResourceMetadata.lastModificationDate = "2021-09-30T16:41:46.980756Z";

// update this timestamp after every release of dsp-api
updateResourceMetadata.newModificationDate = "2023-12-09T08:22:50.236338577Z";
updateResourceMetadata.newModificationDate = "2024-01-27T08:38:45.282914632Z";

knoraApiConnection.v2.res.updateResourceMetadata(updateResourceMetadata).subscribe(
(res: UpdateResourceMetadataResponse) => {
Expand All @@ -560,7 +560,7 @@ describe("ResourcesEndpoint", () => {
expect(res.hasPermissions).toEqual("CR knora-admin:ProjectMember|V knora-admin:ProjectMember");

// update this timestamp after every release of dsp-api
expect(res.lastModificationDate).toEqual("2023-12-09T08:22:50.236338577Z");
expect(res.lastModificationDate).toEqual("2024-01-27T08:38:45.282914632Z");
done();
}
);
Expand All @@ -578,7 +578,7 @@ describe("ResourcesEndpoint", () => {
expectedPayload["http://api.knora.org/ontology/knora-api/v2#lastModificationDate"]["@value"] = "2021-09-30T16:41:46.980756Z";

// update this timestamp after every release of dsp-api
expectedPayload["http://api.knora.org/ontology/knora-api/v2#newModificationDate"]["@value"] = "2023-12-09T08:22:50.236338577Z";
expectedPayload["http://api.knora.org/ontology/knora-api/v2#newModificationDate"]["@value"] = "2024-01-27T08:38:45.282914632Z";

expect(request.data()).toEqual(expectedPayload);

Expand Down
4 changes: 2 additions & 2 deletions src/models/admin/project-restricted-view-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class ProjectRestrictedViewSettings {
/**
* The watermark used in restricted image view in a project.
*/
@JsonProperty("watermark", String, true)
watermark?: string = undefined;
@JsonProperty("watermark", Boolean, true)
watermark?: Boolean = false;

}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"group":{"descriptions":[{"value":"UpdatedGroupDescription","language":"en"}],"id":"http://rdfh.ch/groups/00FF/GwhPohdnSTuXHBHeCb1G-Q","name":"UpdatedGroupName","project":{"description":[{"value":"A demo project of a collection of images","language":"en"}],"id":"http://rdfh.ch/projects/00FF","keywords":["collection","images"],"logo":null,"longname":"Image Collection Demo","ontologies":["http://0.0.0.0:3333/ontology/00FF/images/v2"],"selfjoin":false,"shortcode":"00FF","shortname":"images","status":true},"selfjoin":false,"status":true}}
{"group":{"descriptions":[{"value":"UpdatedGroupDescription","language":"en"}],"id":"http://rdfh.ch/groups/00FF/zGbB3bmGTZeFyApzEtXbaQ","name":"UpdatedGroupName","project":{"description":[{"value":"A demo project of a collection of images","language":"en"}],"id":"http://rdfh.ch/projects/00FF","keywords":["collection","images"],"logo":null,"longname":"Image Collection Demo","ontologies":["http://0.0.0.0:3333/ontology/00FF/images/v2"],"selfjoin":false,"shortcode":"00FF","shortname":"images","status":true},"selfjoin":false,"status":true}}
2 changes: 1 addition & 1 deletion test/data/api/admin/groups/create-group-response.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"group":{"descriptions":[{"value":"NewGroupDescription","language":"en"}],"id":"http://rdfh.ch/groups/00FF/GwhPohdnSTuXHBHeCb1G-Q","name":"NewGroup","project":{"description":[{"value":"A demo project of a collection of images","language":"en"}],"id":"http://rdfh.ch/projects/00FF","keywords":["collection","images"],"logo":null,"longname":"Image Collection Demo","ontologies":["http://0.0.0.0:3333/ontology/00FF/images/v2"],"selfjoin":false,"shortcode":"00FF","shortname":"images","status":true},"selfjoin":false,"status":true}}
{"group":{"descriptions":[{"value":"NewGroupDescription","language":"en"}],"id":"http://rdfh.ch/groups/00FF/zGbB3bmGTZeFyApzEtXbaQ","name":"NewGroup","project":{"description":[{"value":"A demo project of a collection of images","language":"en"}],"id":"http://rdfh.ch/projects/00FF","keywords":["collection","images"],"logo":null,"longname":"Image Collection Demo","ontologies":["http://0.0.0.0:3333/ontology/00FF/images/v2"],"selfjoin":false,"shortcode":"00FF","shortname":"images","status":true},"selfjoin":false,"status":true}}
2 changes: 1 addition & 1 deletion test/data/api/admin/groups/delete-group-response.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"group":{"descriptions":[{"value":"UpdatedGroupDescription","language":"en"}],"id":"http://rdfh.ch/groups/00FF/GwhPohdnSTuXHBHeCb1G-Q","name":"UpdatedGroupName","project":{"description":[{"value":"A demo project of a collection of images","language":"en"}],"id":"http://rdfh.ch/projects/00FF","keywords":["collection","images"],"logo":null,"longname":"Image Collection Demo","ontologies":["http://0.0.0.0:3333/ontology/00FF/images/v2"],"selfjoin":false,"shortcode":"00FF","shortname":"images","status":true},"selfjoin":false,"status":false}}
{"group":{"descriptions":[{"value":"UpdatedGroupDescription","language":"en"}],"id":"http://rdfh.ch/groups/00FF/zGbB3bmGTZeFyApzEtXbaQ","name":"UpdatedGroupName","project":{"description":[{"value":"A demo project of a collection of images","language":"en"}],"id":"http://rdfh.ch/projects/00FF","keywords":["collection","images"],"logo":null,"longname":"Image Collection Demo","ontologies":["http://0.0.0.0:3333/ontology/00FF/images/v2"],"selfjoin":false,"shortcode":"00FF","shortname":"images","status":true},"selfjoin":false,"status":false}}
2 changes: 1 addition & 1 deletion test/data/api/admin/groups/update-group-response.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"group":{"descriptions":[{"value":"UpdatedGroupDescription","language":"en"}],"id":"http://rdfh.ch/groups/00FF/GwhPohdnSTuXHBHeCb1G-Q","name":"UpdatedGroupName","project":{"description":[{"value":"A demo project of a collection of images","language":"en"}],"id":"http://rdfh.ch/projects/00FF","keywords":["collection","images"],"logo":null,"longname":"Image Collection Demo","ontologies":["http://0.0.0.0:3333/ontology/00FF/images/v2"],"selfjoin":false,"shortcode":"00FF","shortname":"images","status":true},"selfjoin":false,"status":true}}
{"group":{"descriptions":[{"value":"UpdatedGroupDescription","language":"en"}],"id":"http://rdfh.ch/groups/00FF/zGbB3bmGTZeFyApzEtXbaQ","name":"UpdatedGroupName","project":{"description":[{"value":"A demo project of a collection of images","language":"en"}],"id":"http://rdfh.ch/projects/00FF","keywords":["collection","images"],"logo":null,"longname":"Image Collection Demo","ontologies":["http://0.0.0.0:3333/ontology/00FF/images/v2"],"selfjoin":false,"shortcode":"00FF","shortname":"images","status":true},"selfjoin":false,"status":true}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parentNodeIri": "http://rdfh.ch/lists/0001/Lxc4VA0OTK6BgTNajUaSkg",
"parentNodeIri": "http://rdfh.ch/lists/0001/64MysiiKQuCBUcb2P9nSVA",
"projectIri": "http://rdfh.ch/projects/0001",
"name": "third",
"labels": [{ "value": "New Third Child List Node Value", "language": "en"}],
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"nodeinfo":{"comments":[{"value":"New Third Child List Node Comment","language":"en"}],"hasRootNode":"http://rdfh.ch/lists/0001/_9NTVHN_Rtei0YDVOyMFKA","id":"http://rdfh.ch/lists/0001/YExnRm64Qa6ju45HYOm_7w","labels":[{"value":"New Third Child List Node Value","language":"en"}],"name":"third","position":0}}
{"nodeinfo":{"comments":[{"value":"New Third Child List Node Comment","language":"en"}],"hasRootNode":"http://rdfh.ch/lists/0001/AZrI-UVJSsK62RmR8CM_jQ","id":"http://rdfh.ch/lists/0001/R5KNrMMFQb-Ws2qR1G-5DA","labels":[{"value":"New Third Child List Node Value","language":"en"}],"name":"third","position":0}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parentNodeIri": "http://rdfh.ch/lists/0001/_9NTVHN_Rtei0YDVOyMFKA",
"parentNodeIri": "http://rdfh.ch/lists/0001/AZrI-UVJSsK62RmR8CM_jQ",
"projectIri": "http://rdfh.ch/projects/0001",
"name": "second",
"labels": [{ "value": "New Second Child List Node Value", "language": "en"}],
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"nodeinfo":{"comments":[{"value":"New Second Child List Node Comment","language":"en"}],"hasRootNode":"http://rdfh.ch/lists/0001/_9NTVHN_Rtei0YDVOyMFKA","id":"http://rdfh.ch/lists/0001/T7JKD_M2SQy_JWkpDid3IQ","labels":[{"value":"New Second Child List Node Value","language":"en"}],"name":"second","position":1}}
{"nodeinfo":{"comments":[{"value":"New Second Child List Node Comment","language":"en"}],"hasRootNode":"http://rdfh.ch/lists/0001/AZrI-UVJSsK62RmR8CM_jQ","id":"http://rdfh.ch/lists/0001/dvSRLm7kTj-Rc8bezwggBg","labels":[{"value":"New Second Child List Node Value","language":"en"}],"name":"second","position":1}}
2 changes: 1 addition & 1 deletion test/data/api/admin/lists/create-child-node-request.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parentNodeIri": "http://rdfh.ch/lists/0001/_9NTVHN_Rtei0YDVOyMFKA",
"parentNodeIri": "http://rdfh.ch/lists/0001/AZrI-UVJSsK62RmR8CM_jQ",
"projectIri": "http://rdfh.ch/projects/0001",
"name": "first",
"labels": [{ "value": "New First Child List Node Value", "language": "en"}],
Expand Down
2 changes: 1 addition & 1 deletion test/data/api/admin/lists/create-child-node-response.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"nodeinfo":{"comments":[{"value":"New First Child List Node Comment","language":"en"}],"hasRootNode":"http://rdfh.ch/lists/0001/_9NTVHN_Rtei0YDVOyMFKA","id":"http://rdfh.ch/lists/0001/kJvaj2--TdiRsFq_3LeoAA","labels":[{"value":"New First Child List Node Value","language":"en"}],"name":"first","position":0}}
{"nodeinfo":{"comments":[{"value":"New First Child List Node Comment","language":"en"}],"hasRootNode":"http://rdfh.ch/lists/0001/AZrI-UVJSsK62RmR8CM_jQ","id":"http://rdfh.ch/lists/0001/m_7XZQ1YRyi7wBw5cap3AQ","labels":[{"value":"New First Child List Node Value","language":"en"}],"name":"first","position":0}}
2 changes: 1 addition & 1 deletion test/data/api/admin/lists/create-list-response.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"list":{"children":[],"listinfo":{"comments":[{"value":"XXXXX","language":"en"}],"id":"http://rdfh.ch/lists/0001/_9NTVHN_Rtei0YDVOyMFKA","isRootNode":true,"labels":[{"value":"Neue Liste","language":"de"}],"projectIri":"http://rdfh.ch/projects/0001"}}}
{"list":{"children":[],"listinfo":{"comments":[{"value":"XXXXX","language":"en"}],"id":"http://rdfh.ch/lists/0001/AZrI-UVJSsK62RmR8CM_jQ","isRootNode":true,"labels":[{"value":"Neue Liste","language":"de"}],"projectIri":"http://rdfh.ch/projects/0001"}}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parentNodeIri": "http://rdfh.ch/lists/0001/_9NTVHN_Rtei0YDVOyMFKA",
"parentNodeIri": "http://rdfh.ch/lists/0001/AZrI-UVJSsK62RmR8CM_jQ",
"projectIri": "http://rdfh.ch/projects/0001",
"name": "child with position",
"position": 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"nodeinfo":{"comments":[{"value":"Inserted List Node Comment","language":"en"}],"hasRootNode":"http://rdfh.ch/lists/0001/_9NTVHN_Rtei0YDVOyMFKA","id":"http://rdfh.ch/lists/0001/Lxc4VA0OTK6BgTNajUaSkg","labels":[{"value":"Inserted List Node Label","language":"en"}],"name":"child with position","position":1}}
{"nodeinfo":{"comments":[{"value":"Inserted List Node Comment","language":"en"}],"hasRootNode":"http://rdfh.ch/lists/0001/AZrI-UVJSsK62RmR8CM_jQ","id":"http://rdfh.ch/lists/0001/64MysiiKQuCBUcb2P9nSVA","labels":[{"value":"Inserted List Node Label","language":"en"}],"name":"child with position","position":1}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"administrative_permission":{"forGroup":"http://rdfh.ch/groups/0001/thing-searcher","forProject":"http://rdfh.ch/projects/0001","hasPermissions":[{"additionalInformation":null,"name":"ProjectAdminGroupAllPermission","permissionCode":null}],"iri":"http://rdfh.ch/permissions/0001/BG9DpHJjSym_UR9-rIp4ww"}}
{"administrative_permission":{"forGroup":"http://rdfh.ch/groups/0001/thing-searcher","forProject":"http://rdfh.ch/projects/0001","hasPermissions":[{"additionalInformation":null,"name":"ProjectAdminGroupAllPermission","permissionCode":null}],"iri":"http://rdfh.ch/permissions/0001/Ts3oGlUlSEG8r4zw9ku3ww"}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"default_object_access_permission":{"forGroup":"http://rdfh.ch/groups/0001/thing-searcher","forProject":"http://rdfh.ch/projects/0001","forProperty":null,"forResourceClass":null,"hasPermissions":[{"additionalInformation":"http://www.knora.org/ontology/knora-admin#ProjectMember","name":"D","permissionCode":7}],"iri":"http://rdfh.ch/permissions/0001/QxX6MPx9SVGpOoyEy24RPg"}}
{"default_object_access_permission":{"forGroup":"http://rdfh.ch/groups/0001/thing-searcher","forProject":"http://rdfh.ch/projects/0001","forProperty":null,"forResourceClass":null,"hasPermissions":[{"additionalInformation":"http://www.knora.org/ontology/knora-admin#ProjectMember","name":"D","permissionCode":7}],"iri":"http://rdfh.ch/permissions/0001/2AXKqE9GQFaxJ4215w5eDg"}}
2 changes: 1 addition & 1 deletion test/data/api/admin/projects/create-project-response.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"project":{"description":[{"value":"project description","language":"en"}],"id":"http://rdfh.ch/projects/Z4jVLOa4StiBCSWMwDFg-Q","keywords":["keywords"],"logo":"/fu/bar/baz.jpg","longname":"project longname","ontologies":[],"selfjoin":false,"shortcode":"1111","shortname":"newproject","status":true}}
{"project":{"description":[{"value":"project description","language":"en"}],"id":"http://rdfh.ch/projects/HqaJxDszSmOzqOK1hl7Ilg","keywords":["keywords"],"logo":"/fu/bar/baz.jpg","longname":"project longname","ontologies":[],"selfjoin":false,"shortcode":"1111","shortname":"newproject","status":true}}
2 changes: 1 addition & 1 deletion test/data/api/admin/projects/delete-project-response.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"project":{"description":[{"value":"Test Project","language":"en"},{"value":"Test Project","language":"se"}],"id":"http://rdfh.ch/projects/Z4jVLOa4StiBCSWMwDFg-Q","keywords":["keywords","updated"],"logo":"/fu/bar/baz-updated.jpg","longname":"updated project longname","ontologies":[],"selfjoin":true,"shortcode":"1111","shortname":"updatedproject","status":false}}
{"project":{"description":[{"value":"Test Project","language":"en"},{"value":"Test Project","language":"se"}],"id":"http://rdfh.ch/projects/HqaJxDszSmOzqOK1hl7Ilg","keywords":["keywords","updated"],"logo":"/fu/bar/baz-updated.jpg","longname":"updated project longname","ontologies":[],"selfjoin":true,"shortcode":"1111","shortname":"updatedproject","status":false}}
Loading

0 comments on commit 61e0566

Please sign in to comment.