Skip to content

Commit

Permalink
nativex: update API
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet committed Oct 14, 2023
1 parent 6baf1bc commit bbacd7a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/native/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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+$
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit bbacd7a

Please sign in to comment.