Skip to content

Commit

Permalink
2.0.0-beta.7
Browse files Browse the repository at this point in the history
  • Loading branch information
raucao committed Oct 9, 2024
1 parent c0e9596 commit 82ea1fb
Show file tree
Hide file tree
Showing 42 changed files with 1,169 additions and 287 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "remotestoragejs",
"description": "JavaScript library for integrating remoteStorage",
"version": "2.0.0-beta.6",
"version": "2.0.0-beta.7",
"private": false,
"license": "MIT",
"main": "./release/remotestorage.js",
Expand Down
29 changes: 2 additions & 27 deletions release/remotestorage.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions release/remotestorage.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*!
* webfinger.js
* http://github.com/silverbucket/webfinger.js
*
* Developed and Maintained by:
* Nick Jennings <nick@silverbucket.net>
*
* webfinger.js is released under the AGPL (see LICENSE).
*
* You don't have to do anything special to choose one license or the other and you don't
* have to notify anyone which license you are using.
* Please see the corresponding license file for details of these licenses.
* You are free to use, modify and distribute this software, but all copyright
* information must remain.
*
*/

/*! remotestorage.js 2.0.0-beta.7, https://remotestorage.io, MIT licensed */
2 changes: 1 addition & 1 deletion release/remotestorage.js.map

Large diffs are not rendered by default.

65 changes: 44 additions & 21 deletions release/types/access.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare type AccessMode = 'r' | 'rw';
declare type AccessScope = string;
export type AccessMode = 'r' | 'rw';
export type AccessScope = string;
interface ScopeEntry {
name: string;
mode: AccessMode;
Expand All @@ -8,62 +8,84 @@ interface ScopeModeMap {
[key: string]: AccessMode;
}
/**
* @class Access
* @class
*
* Keeps track of claimed access and scopes.
* This class is for requesting and managing access to modules/folders on the
* remote. It gets initialized as `remoteStorage.access`.
*/
declare class Access {
export declare class Access {
scopeModeMap: ScopeModeMap;
rootPaths: string[];
storageType: string;
static _rs_init(): void;
constructor();
/**
* Property: scopes
* Holds an array of claimed scopes:
*
* Holds an array of claimed scopes in the form
* > { name: "<scope-name>", mode: "<mode>" }
* ```javascript
* [{ name: "<scope-name>", mode: "<mode>" }]
* ```
*
* @ignore
*/
get scopes(): ScopeEntry[];
get scopeParameter(): string;
/**
* Claim access on a given scope with given mode.
*
* @param {string} scope - An access scope, such as "contacts" or "calendar"
* @param {string} mode - Access mode. Either "r" for read-only or "rw" for read/write
* @param scope - An access scope, such as `contacts` or `calendar`
* @param mode - Access mode. Either `r` for read-only or `rw` for read/write
*
* @example
* ```javascript
* remoteStorage.access.claim('contacts', 'r');
* remoteStorage.access.claim('pictures', 'rw');
* ```
*
* Claiming root access, meaning complete access to all files and folders of a storage, can be done using an asterisk for the scope:
*
* ```javascript
* remoteStorage.access.claim('*', 'rw');
* ```
*/
claim(scope: AccessScope, mode: AccessMode): void;
/**
* Get the access mode for a given scope.
*
* @param {string} scope - Access scope
* @returns {string} Access mode
* @param scope - Access scope
* @returns Access mode
* @ignore
*/
get(scope: AccessScope): AccessMode;
/**
* Remove access for the given scope.
*
* @param {string} scope - Access scope
* @param scope - Access scope
* @ignore
*/
remove(scope: AccessScope): void;
/**
* Verify permission for a given scope.
*
* @param {string} scope - Access scope
* @param {string} mode - Access mode
* @returns {boolean} true if the requested access mode is active, false otherwise
* @param scope - Access scope
* @param mode - Access mode
* @returns `true` if the requested access mode is active, `false` otherwise
* @ignore
*/
checkPermission(scope: AccessScope, mode: AccessMode): boolean;
/**
* Verify permission for a given path.
*
* @param {string} path - Path
* @param {string} mode - Access mode
* @returns {boolean} true if the requested access mode is active, false otherwise
* @param path - Path
* @param mode - Access mode
* @returns true if the requested access mode is active, false otherwise
* @ignore
*/
checkPathPermission(path: string, mode: AccessMode): boolean;
/**
* Reset all access permissions.
*
* @ignore
*/
reset(): void;
/**
Expand All @@ -81,9 +103,10 @@ declare class Access {
/**
* Set the storage type of the remote.
*
* @param {string} type - Storage type
* @param type - Storage type
* @internal
*/
setStorageType(type: string): void;
}
export = Access;
export default Access;
//# sourceMappingURL=access.d.ts.map
2 changes: 1 addition & 1 deletion release/types/access.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions release/types/authorize.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import RemoteStorage from './remotestorage';
import { AuthorizeOptions } from "./interfaces/authorize_options";
import { Remote } from "./remote";
interface AuthResult {
access_token?: string;
Expand All @@ -10,7 +9,24 @@ interface AuthResult {
remotestorage?: string;
state?: string;
}
declare class Authorize {
export interface AuthorizeOptions {
/** URL of the authorization endpoint */
authURL: string;
/** access scope */
scope?: string;
redirectUri?: string;
/**
* client identifier
* @defaultValue Origin of the redirectUri
* */
clientId?: string;
response_type?: 'token' | 'code';
state?: string;
code_challenge?: string;
code_challenge_method?: 'S256' | 'plain';
token_access_type?: 'online' | 'offline';
}
export declare class Authorize {
static IMPLIED_FAKE_TOKEN: boolean;
/**
* Navigates browser to provider's OAuth page. When user grants access,
Expand Down Expand Up @@ -40,5 +56,5 @@ declare class Authorize {
static _rs_init: (remoteStorage: RemoteStorage) => void;
static _rs_cleanup(remoteStorage: RemoteStorage): void;
}
export = Authorize;
export default Authorize;
//# sourceMappingURL=authorize.d.ts.map
2 changes: 1 addition & 1 deletion release/types/authorize.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82ea1fb

Please sign in to comment.