Closed SaschaAdler closed 3 years ago
@RussellMcOrmond did I miss anything in the list above?
ArchivalManifest is what launches smelter, so I'm guessing that porting it over will be soonish?
I've been the only one actively using it, to try to keep the two sets of databases updated with the things they are adding (and I do that whenever I run loadseries
as it complains about any missing manifest noid that it tries to add to collections). I have tickets coming up where I'll be doing loadseries
stuff.
How to convert code from client-side Couch requests to server-side Couch requests, using repository stats as an example:
refreshValues
method. Since repository
is a static route, i.e. it doesn't accept any parameters, this server route should be set up in routes/repository.json.js
. Server routes, like client routes, can accept parameters by using square brackets in the file/directory name.repository.json.js
should export a get
method, which performs Couch calls and For an example of a server route that exports a get method, see routes/collection/slug/[slug].json.js
.res.finalizeJSON(obj)
, where obj
is an Object with three fields:
status
: HTTP status code. The repository get method should return 200 on success. Don't worry about errors yet.content
: the JSON content output when the server route completes successfully, or {}
if the route has an errormessage
: the error message text, if there has been an error. Not required on successful route completionsresources/couch.js
instead of couch.js
. Couch calls will not need an authentication token because they are only performed on the server. If the server routes are long and complicated, or if there are multiple routes relating to the same logical concept, their code can be refactored into the models
directory.
refreshValues
into the server route. There is also a utility function calculateHuman
and an import of the filesize
package that need to be carried over. The filesize
import should actually use import
.couch/repository.js
that call _request
in couch.js
. I suspect these methods are not actually necessary, as the generic Couch calling functions in resources/couch.js
should handle the things they're trying to do. If we need to add new generic functions in resources/couch.js
, we can.content
object that should be sent to res.finalizeJSON()
is, but it should contain all of the data that refreshValues
puts together.preload
method in the client route's module context to fetch the data from the server route.
routes/collection/[prefix]/[noid]/index.svelte
for an example. The one for repository stats won't be as complex.Am I correct in thinking that https://github.com/crkn-rcdr/sapindale/blob/main/src/couch/repository.js is no longer used, and can be removed?
Of the remaining things in https://github.com/crkn-rcdr/sapindale/tree/main/src/couch , should I take on any?
dmdtask.js
is part of the first stage of the new Descriptive Metadata Uploader https://admin.canadiana.ca/dmd . This has other work underway, and may be a good place for someone to be learning more about schemas https://github.com/crkn-rcdr/Access-Platform/pull/55internalmeta.js
is used by https://admin.canadiana.ca/internalmeta to approve/unapprove and add collection tags in the old access platform. Not much learning of the old platform is needed to learn how to test this.packaging.js
is used by https://admin.canadiana.ca/packaging which is the old repository system. It feels like it would make sense for me to take this one on rather than someone else trying to learn the old system, as well as knowing what to do to test it.I know that @DivyaKrishnan26 is currently working on CouchView. As part of that the array of known databases in https://github.com/crkn-rcdr/sapindale/blob/main/src/couch.js should be moved elsewhere, as I believe part of the goal of this ticket is to remove that file.
During @DivyaKrishnan26 's vacation I will be taking these on for a bit, and seeing how I progress.
Sapindale client code shouldn't be talking to Couch directly. Rewrite components to use server routes to talk to Couch.
Currently in use:
Not currently in use (and can therefore be put off until later):
As a result of this change, we can switch to using nano instead of rolling our own Couch request code.