Skip to content

Commit 82ea1fb

Browse files
committed
2.0.0-beta.7
1 parent c0e9596 commit 82ea1fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1169
-287
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "remotestoragejs",
33
"description": "JavaScript library for integrating remoteStorage",
4-
"version": "2.0.0-beta.6",
4+
"version": "2.0.0-beta.7",
55
"private": false,
66
"license": "MIT",
77
"main": "./release/remotestorage.js",

release/remotestorage.js

+2-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/remotestorage.js.LICENSE.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*!
2+
* webfinger.js
3+
* http://github.com/silverbucket/webfinger.js
4+
*
5+
* Developed and Maintained by:
6+
* Nick Jennings <[email protected]>
7+
*
8+
* webfinger.js is released under the AGPL (see LICENSE).
9+
*
10+
* You don't have to do anything special to choose one license or the other and you don't
11+
* have to notify anyone which license you are using.
12+
* Please see the corresponding license file for details of these licenses.
13+
* You are free to use, modify and distribute this software, but all copyright
14+
* information must remain.
15+
*
16+
*/
17+
18+
/*! remotestorage.js 2.0.0-beta.7, https://remotestorage.io, MIT licensed */

release/remotestorage.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/types/access.d.ts

+44-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
declare type AccessMode = 'r' | 'rw';
2-
declare type AccessScope = string;
1+
export type AccessMode = 'r' | 'rw';
2+
export type AccessScope = string;
33
interface ScopeEntry {
44
name: string;
55
mode: AccessMode;
@@ -8,62 +8,84 @@ interface ScopeModeMap {
88
[key: string]: AccessMode;
99
}
1010
/**
11-
* @class Access
11+
* @class
1212
*
13-
* Keeps track of claimed access and scopes.
13+
* This class is for requesting and managing access to modules/folders on the
14+
* remote. It gets initialized as `remoteStorage.access`.
1415
*/
15-
declare class Access {
16+
export declare class Access {
1617
scopeModeMap: ScopeModeMap;
1718
rootPaths: string[];
1819
storageType: string;
1920
static _rs_init(): void;
2021
constructor();
2122
/**
22-
* Property: scopes
23+
* Holds an array of claimed scopes:
2324
*
24-
* Holds an array of claimed scopes in the form
25-
* > { name: "<scope-name>", mode: "<mode>" }
25+
* ```javascript
26+
* [{ name: "<scope-name>", mode: "<mode>" }]
27+
* ```
28+
*
29+
* @ignore
2630
*/
2731
get scopes(): ScopeEntry[];
2832
get scopeParameter(): string;
2933
/**
3034
* Claim access on a given scope with given mode.
3135
*
32-
* @param {string} scope - An access scope, such as "contacts" or "calendar"
33-
* @param {string} mode - Access mode. Either "r" for read-only or "rw" for read/write
36+
* @param scope - An access scope, such as `contacts` or `calendar`
37+
* @param mode - Access mode. Either `r` for read-only or `rw` for read/write
38+
*
39+
* @example
40+
* ```javascript
41+
* remoteStorage.access.claim('contacts', 'r');
42+
* remoteStorage.access.claim('pictures', 'rw');
43+
* ```
44+
*
45+
* Claiming root access, meaning complete access to all files and folders of a storage, can be done using an asterisk for the scope:
46+
*
47+
* ```javascript
48+
* remoteStorage.access.claim('*', 'rw');
49+
* ```
3450
*/
3551
claim(scope: AccessScope, mode: AccessMode): void;
3652
/**
3753
* Get the access mode for a given scope.
3854
*
39-
* @param {string} scope - Access scope
40-
* @returns {string} Access mode
55+
* @param scope - Access scope
56+
* @returns Access mode
57+
* @ignore
4158
*/
4259
get(scope: AccessScope): AccessMode;
4360
/**
4461
* Remove access for the given scope.
4562
*
46-
* @param {string} scope - Access scope
63+
* @param scope - Access scope
64+
* @ignore
4765
*/
4866
remove(scope: AccessScope): void;
4967
/**
5068
* Verify permission for a given scope.
5169
*
52-
* @param {string} scope - Access scope
53-
* @param {string} mode - Access mode
54-
* @returns {boolean} true if the requested access mode is active, false otherwise
70+
* @param scope - Access scope
71+
* @param mode - Access mode
72+
* @returns `true` if the requested access mode is active, `false` otherwise
73+
* @ignore
5574
*/
5675
checkPermission(scope: AccessScope, mode: AccessMode): boolean;
5776
/**
5877
* Verify permission for a given path.
5978
*
60-
* @param {string} path - Path
61-
* @param {string} mode - Access mode
62-
* @returns {boolean} true if the requested access mode is active, false otherwise
79+
* @param path - Path
80+
* @param mode - Access mode
81+
* @returns true if the requested access mode is active, false otherwise
82+
* @ignore
6383
*/
6484
checkPathPermission(path: string, mode: AccessMode): boolean;
6585
/**
6686
* Reset all access permissions.
87+
*
88+
* @ignore
6789
*/
6890
reset(): void;
6991
/**
@@ -81,9 +103,10 @@ declare class Access {
81103
/**
82104
* Set the storage type of the remote.
83105
*
84-
* @param {string} type - Storage type
106+
* @param type - Storage type
107+
* @internal
85108
*/
86109
setStorageType(type: string): void;
87110
}
88-
export = Access;
111+
export default Access;
89112
//# sourceMappingURL=access.d.ts.map

release/types/access.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

release/types/authorize.d.ts

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import RemoteStorage from './remotestorage';
2-
import { AuthorizeOptions } from "./interfaces/authorize_options";
32
import { Remote } from "./remote";
43
interface AuthResult {
54
access_token?: string;
@@ -10,7 +9,24 @@ interface AuthResult {
109
remotestorage?: string;
1110
state?: string;
1211
}
13-
declare class Authorize {
12+
export interface AuthorizeOptions {
13+
/** URL of the authorization endpoint */
14+
authURL: string;
15+
/** access scope */
16+
scope?: string;
17+
redirectUri?: string;
18+
/**
19+
* client identifier
20+
* @defaultValue Origin of the redirectUri
21+
* */
22+
clientId?: string;
23+
response_type?: 'token' | 'code';
24+
state?: string;
25+
code_challenge?: string;
26+
code_challenge_method?: 'S256' | 'plain';
27+
token_access_type?: 'online' | 'offline';
28+
}
29+
export declare class Authorize {
1430
static IMPLIED_FAKE_TOKEN: boolean;
1531
/**
1632
* Navigates browser to provider's OAuth page. When user grants access,
@@ -40,5 +56,5 @@ declare class Authorize {
4056
static _rs_init: (remoteStorage: RemoteStorage) => void;
4157
static _rs_cleanup(remoteStorage: RemoteStorage): void;
4258
}
43-
export = Authorize;
59+
export default Authorize;
4460
//# sourceMappingURL=authorize.d.ts.map

release/types/authorize.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

0 commit comments

Comments
 (0)