wellcomecollection / stacks-service Goto Github PK
View Code? Open in Web Editor NEWAPIs for fetching the availability of items and making requests for items
APIs for fetching the availability of items and making requests for items
patronId
from cognito on clientWhen authorising on the client to get the id_token
used to authenticate against Cognito and API gateway, we request the patronId
then.
This will then be encoded in the authorization
header and the application will be able to decode it as a JWT.
Currently the Catalogue API presents locations as Object
typed - which is inconvenient as they cannot then be used in the stacks service.
We need to:
Required for: #26
In order that the item-requests services have somewhere to run they need a VPC and all that gubbins.
We currently pass the generic API gateway error responses instead of showing the nice shiny errors from the services.
What does appropriate feedback mean?
We don't need to put authentication in front of the items API (the information should be visible without logging in, at which point it's basically public).
We should deploy the items API without authentication, so that somebody can make requests and get responses.
This opens the door to the front-end starting to use this information.
We should allow a user to request multiple items at a time to allow timely and efficient responses to a client wanting the same.
What should this look like in our API?
In order to easily and reliably interact with the Catalogue API we should make use of its' Swagger client code generation capability.
For #25
As part of getting started on the requesting work, we should all be able to compile this service and run tests.
These were removed in trying to get a working example
What does requestable mean?
What states can this be in?
What about me?
In order to properly report hold status we need to know if a hold has been placed!
In order to easily and reliably interact with the Sierra API we should make use of the Swagger client code generation capability for Sierra.
For #25
In order to demonstrate reacting to a user authenticated status we should run an experiment in the front-end that notices if a user is signed in and provides console feedback if they are.
In order to understand if/how we are changing existing behaviour we should document existing behaviour in a markdown document in this repository.
The API should provide a spec in OAS 3.0 format.
We need to determine a valid spec before productionising!
Should we provide a mechanism to look up the status for an individual item for a particular user?
At present the client needs to request a users holds and then cross reference that with the items on a page - this causes both the API and the client to do unnecessary work.
I suggest filtering the GET /requests
response with itemId
, e.g.
GET /requests?itemId=abcdef
In order to understand what client/server interactions must take place we need to understand and document the cognito auth flow in markdown in this repository.
Required for:
Users need to be authenticated with Cognito in the client:
Note: Are we comfortable storing the access token in the client? If we need to terminate a users access immediately how can we ensure their access tokens stop working? How can we invalidate a users access token if they are signed out?
https://api.wellcomecollection.org/stacks/v1/status/works/:id needs to return
{
"@context": "https://api.wellcomecollection.org/catalogue/v2/context.json",
"type": "Work",
"items": [{
"id": "ys3ern6x",
"identifiers": [{
"identifierType": {
"id": "sierra-system-number",
"label": "Sierra system number",
"type": "IdentifierType"
},
"value": "i16010176",
"type": "Identifier"
},
{
"identifierType": {
"id": "sierra-identifier",
"label": "Sierra identifier",
"type": "IdentifierType"
},
"value": "1601017",
"type": "Identifier"
}
],
"locations": [{
"locationType": {
"id": "sicon",
"label": "Closed stores Iconographic",
"type": "LocationType"
},
"label": "Closed stores Iconographic",
"type": "PhysicalLocation"
},
{
"locationType": {
"id": "iiif-presentation",
"label": "IIIF Presentation API",
"type": "LocationType"
},
"url": "https://wellcomelibrary.org/iiif/b16656180/manifest",
"type": "DigitalLocation"
},
{
"locationType": {
"id": "iiif-image",
"label": "IIIF Image API",
"type": "LocationType"
},
"url": "https://iiif.wellcomecollection.org/image/L0053261.jpg/info.json",
"credit": "Wellcome Collection",
"license": {
"id": "cc-by-nc",
"label": "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)",
"url": "https://creativecommons.org/licenses/by-nc/4.0/",
"type": "License"
},
"type": "DigitalLocation"
}
],
"type": "Item",
"status": {
"label": "Available",
"id": "available"
}
}]
}
We should have:
https://api.wellcomecollection.org/item-status
|
↓
https://item-status.api.wellcomecollection.org/
|
↓
https://api-gateway-id.execute-api.eu-west-1.amazonaws.com/stage
POST /requests/works/{workId}/items/{itemId}
=> /users/{userId} PAYLOAD {"itemId": "12345"}
Provide a view on "physical" items and their location on a works page.
Add a note saying when a person wants something. Or neededBy
.
What makes an item requestable?
Can we not think about the cart?
What's average books person on request?
What would we want to surface on the client?
Structure
/items returns
{
"status": "on Request",
//private
"requestedByMe": true
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.