Skip to content

Commit

Permalink
broker connector page (#295)
Browse files Browse the repository at this point in the history
* chore: initial broker server model

* feat: broker connector page
  • Loading branch information
richardtreier authored May 31, 2023
1 parent 1fd31e9 commit cefde2e
Show file tree
Hide file tree
Showing 42 changed files with 711 additions and 388 deletions.
163 changes: 0 additions & 163 deletions fake-backend/json/brokerCatalog.json

This file was deleted.

79 changes: 79 additions & 0 deletions fake-backend/json/brokerCatalogPage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"availableFilters": {"fields": []},
"availableSortings": [
{"sorting": "MOST_RECENT", "title": "Most Recent"},
{"sorting": "TITLE", "title": "By Title"},
{"sorting": "ORIGINATOR", "title": "By Connector"}
],
"paginationMetadata": {
"numTotal": 1,
"numVisible": 1,
"pageOneBased": 1,
"pageSize": 1
},
"dataOffers": [
{
"assetId": "urn:artifact:my-asset",
"connectorEndpoint": "http://my-connector/ids/data",
"connectorOnlineStatus": "ONLINE",
"connectorOfflineSinceOrLastUpdatedAt": "2023-05-31T12:02:41+02:00",
"createdAt": "2023-05-26T12:02:41+02:00",
"updatedAt": "2023-05-31T12:02:41+02:00",
"properties": {
"asset:prop:id": "urn:artifact:db-rail-network-2023-jan",
"asset:prop:name": "Rail Network DB 2023 January",
"asset:prop:version": "1.1",
"asset:prop:originator": "https://example-connector.rail-mgmt.bahn.de/api/v1/ids/data",
"asset:prop:originatorOrganization": "Deutsche Bahn AG",
"asset:prop:keywords": "db, bahn, rail, Rail-Designer",
"asset:prop:contenttype": "application/json",
"asset:prop:description": "Train Network Map released on 10.01.2023, valid until 31.02.2023. \nFile format is xyz as exported by Rail-Designer.",
"asset:prop:language": "https://w3id.org/idsa/code/EN",
"asset:prop:publisher": "https://my.cool-api.gg/about",
"asset:prop:standardLicense": "https://my.cool-api.gg/license",
"asset:prop:endpointDocumentation": "https://my.cool-api.gg/docs",
"http://w3id.org/mds#dataCategory": "Infrastructure and Logistics",
"http://w3id.org/mds#dataSubcategory": "General Information About Planning Of Routes",
"http://w3id.org/mds#dataModel": "my-data-model-001",
"http://w3id.org/mds#geoReferenceMethod": "my-geo-reference-method",
"http://w3id.org/mds#transportMode": "Rail"
},
"contractOffers": [
{
"contractOfferId": "my-contract-offer-1",
"createdAt": "2023-05-26T12:02:41+02:00",
"updatedAt": "2023-05-31T12:02:41+02:00",
"contractPolicy": {
"legacyPolicy": {
"permissions": [
{
"edctype": "dataspaceconnector:permission",
"action": {
"type": "USE"
},
"constraints": [
{
"edctype": "AtomicConstraint",
"leftExpression": {
"edctype": "dataspaceconnector:literalexpression",
"value": "ALWAYS_TRUE"
},
"rightExpression": {
"edctype": "dataspaceconnector:literalexpression",
"value": "true"
},
"operator": "EQ"
}
]
}
],
"@type": {
"@policytype": "set"
}
}
}
}
]
}
]
}
30 changes: 30 additions & 0 deletions fake-backend/json/brokerConnectorPage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"availableSortings": [
{"sorting": "MOST_RECENT", "title": "Most Recent"},
{"sorting": "TITLE", "title": "By Title"}
],
"paginationMetadata": {
"numTotal": 2,
"numVisible": 2,
"pageOneBased": 2,
"pageSize": 1
},
"connectors": [
{
"id": "https://example.com",
"endpoint": "https://example.com/ids/data",
"createdAt": "2023-05-31T14:06:21.536182+02:00",
"onlineStatus": "OFFLINE",
"numContractOffers": 0
},
{
"id": "https://other-connector.com",
"endpoint": "https://other-connector.com/ids/data",
"createdAt": "2023-05-31T14:06:21.536182+02:00",
"lastSuccessfulRefreshAt": "2023-05-31T14:06:21.536182+02:00",
"lastRefreshAttemptAt": "2023-05-31T14:06:21.536182+02:00",
"onlineStatus": "ONLINE",
"numContractOffers": 2
}
]
}
8 changes: 6 additions & 2 deletions fake-backend/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,13 @@ app.get('/api/v1/data/wrapper/ui/pages/contract-agreement-page', (_, res) => {
});

// Broker API Wrapper
const brokerCatalog = json('json/brokerCatalog.json');
const brokerCatalogPage = json('json/brokerCatalogPage.json');
app.post('/api/v1/data/wrapper/broker/catalog-page', (_, res) => {
res.json(brokerCatalog);
res.json(brokerCatalogPage);
});
const brokerConnectorPage = json('json/brokerConnectorPage.json');
app.post('/api/v1/data/wrapper/broker/connector-page', (_, res) => {
res.json(brokerConnectorPage);
});

app.listen(3000, function () {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@angular/platform-browser-dynamic": "^14.3.0",
"@angular/router": "^14.3.0",
"@ng-apimock/core": "^3.6.0",
"@sovity.de/edc-client": "0.20230517.123454-main-2f926aa6",
"@sovity.de/edc-client": "0.20230531.73811-main-e140ef56",
"clean-deep": "^3.4.0",
"date-fns": "^2.29.3",
"dotenv": "^16.0.3",
Expand Down
Loading

0 comments on commit cefde2e

Please sign in to comment.