Describe the feature
Currently the server only supports one set of changes per user, meaning that applications can't support mutliple resources at the same time.
A "resources" feature could be added which does the following:
Adds a resources CRUD object which at least includes the fields: id, ownerId
Updates the REST API like so:
/resources [POST, GET]
/resources/:id [GET, PATCH, DELETE]
`/resources/:resourceId/changes [GET, POST]``
Resources could be a more standard API resources and would not be 'local-first' in the same way that data contained within changes are.
A change would have a relationship to a resource entity via an additional resourceId field and the userId would be removed from changes in favour of using the ownerId on the vault for access control checks.
On the deletion of a resource this should cascade to deleting all related changes, and on deleting a user this should cascade to deleting all resources (and changes).
Additional context
I need to consider if adding a 'resourceId' field to changes would be enough, or if this seperate API resource would be useful.
Describe the feature Currently the server only supports one set of changes per user, meaning that applications can't support mutliple resources at the same time.
A "resources" feature could be added which does the following:
resources
CRUD object which at least includes the fields:id, ownerId
/resources [POST, GET]
/resources/:id [GET, PATCH, DELETE]
Resources could be a more standard API resources and would not be 'local-first' in the same way that data contained within changes are.
A change would have a relationship to a resource entity via an additional
resourceId
field and theuserId
would be removed from changes in favour of using theownerId
on the vault for access control checks.On the deletion of a resource this should cascade to deleting all related changes, and on deleting a user this should cascade to deleting all resources (and changes).
Additional context I need to consider if adding a 'resourceId' field to changes would be enough, or if this seperate API resource would be useful.