nativex: update API

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/877/head
Varun Patil 2023-10-13 23:27:06 -07:00
parent 6baf1bc3f7
commit bbacd7ad36
1 changed files with 8 additions and 7 deletions

View File

@ -5,12 +5,20 @@ export const BASE_URL = 'http://127.0.0.1';
/** NativeX asynchronous API */
export const NAPI = {
/**
* Login to Nextcloud server.
* @regex ^/api/login/.+$
* @param url URL to Nextcloud server
*/
LOGIN: (url: string) => `${BASE_URL}/api/login/${euc(euc(url))}`,
/**
* Local days API.
* @regex ^/api/days$
* @returns {IDay[]} for all locally available days.
*/
DAYS: () => `${BASE_URL}/api/days`,
/**
* Local photos API.
* @regex ^/api/days/\d+$
@ -113,13 +121,6 @@ export type NativeX = {
*/
toast: (message: string, long?: boolean) => void;
/**
* Start the login process
* @param baseUrl Base URL of the Nextcloud instance
* @param loginFlowUrl URL to start the login flow
*/
login: (baseUrl: string, loginFlowUrl: string) => void;
/**
* Log out from Nextcloud and delete the tokens.
*/