the name of the current profile.
This is a reactive property. Whenever changed, the currentProfile
in the localStorage
will be updated
an array of local profile names and their associated information
the access token type. If this field is non-empty, that means we have a valid access token and can communicate with the backend.
parse a profile from string, add it to the list of profiles, store it in localStorage, and set Profile.current to be the newly added profile. If the newly added profile overwrites an existing profile that is marked as remote, also upload it to the remote
the profile to add
the fallback name if newProfile
does not contain the name of the profile
the message shown to the user if there already exists a profile of the same name
delete a profile. If remote and requestRemote=true, also delete it from the remote.
A noti message containing the name of the previous profile if the deleted profile is selected, undefined otherwise
using the code, request an access token.
get the redirect url for the authorization code flow. For the desktop app (electron), a configured uri will be used.
get a specific version of a profile
initialize profile storage if it does not exist already. set Profile.current to the name of the latest semester
redirect to the url for requesting an authorization code. It should redirect back with the code attached to the url.
rename a profile. If remote=true, also rename the remote profile. note that name duplication is not checked! This check should be done by the caller.
the content fetched from localStorage.getItem(oldName)
request a backend api endpoint with authorization headers
url for the api endpoint
the request object
upload the list of profiles given to the remote, and also update their version histories
an error message when failed, undefined when success
Generated using TypeDoc
the profile class handles profiles adding, renaming and deleting
profile selection is handled in the Store class because it also needs to manipulate other store modules
Hanzhi Zhou