CenterForDigitalHumanities / TPEN-services

Services required by TPEN interfaces in order to interact with data
1 stars 0 forks source link

Create Project from web resources #72

Open cubap opened 7 months ago

cubap commented 7 months ago

/project/create

cubap commented 7 months ago

An action within the /project endpoint needs to be created that creates a new project. This may be divided into subissues if the scope is too big (specifially for an OSS task).

At GET /project/new?URL we will support clickable links from other applications. For this reason, it must be a GET and contain all the information needed in the querystring. Obvious note that the URL in the querystring will be URLencoded and may need to be decoded for use as a fetch.

First, the user must be known, so this GET will interact with a login. The API will need to validate and fetch the link to create the project. If the link does not resolve to a known type (IIIF Manifest v2 or v3, or a supported Image format), the result should be a "Create Project from External Resource" page that is not yet ticketed.

After the GET resolves, the resulting page is the Project Management or Project Information page, unless there is an alternative in the querystring.

At POST /project/create we will be able to generate new projects by accepting a JSON body that describes most of the required parts of the new project. What follows are some examples that does not set the requirements for this call or the authoritative shape of a project.

Key Value Example
_id ObjectID() *assigned by db or reserved
creator URL "https://store.rerum.io/v1/id/agent-hex" *assigned by authenticator
name String "DisplayName for Project I want to read"
group ObjectID() or hex *generated or declared
layers Array [] *empty unless defined
viewer, license, tools, options various default if not defined
manifest or images URL or [URL] as with GET

The POST action should always respond RESTfully with a 201, Location header for the project info page, and have the _id value as the body.

Both of these will require some sort of ProjectFactory() and tips its hand towards other methods to apply metadata, create Layers, modify groups, etc. so remain aware of when to stop.

Out of Scope