@jbrowse/plugin-authentication 2.5.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DropboxOAuthModel/configSchema.d.ts +3 -14
- package/dist/DropboxOAuthModel/configSchema.js +0 -8
- package/dist/DropboxOAuthModel/configSchema.js.map +1 -1
- package/dist/DropboxOAuthModel/model.d.ts +35 -33
- package/dist/DropboxOAuthModel/model.js +26 -35
- package/dist/DropboxOAuthModel/model.js.map +1 -1
- package/dist/DropboxOAuthModel/util.d.ts +1 -0
- package/dist/DropboxOAuthModel/util.js +28 -0
- package/dist/DropboxOAuthModel/util.js.map +1 -0
- package/dist/ExternalTokenModel/ExternalTokenEntryForm.d.ts +2 -1
- package/dist/ExternalTokenModel/ExternalTokenEntryForm.js +10 -11
- package/dist/ExternalTokenModel/ExternalTokenEntryForm.js.map +1 -1
- package/dist/GoogleDriveOAuthModel/GoogleDriveFilehandle.d.ts +15 -0
- package/dist/GoogleDriveOAuthModel/GoogleDriveFilehandle.js +20 -0
- package/dist/GoogleDriveOAuthModel/GoogleDriveFilehandle.js.map +1 -0
- package/dist/GoogleDriveOAuthModel/configSchema.d.ts +0 -5
- package/dist/GoogleDriveOAuthModel/model.d.ts +36 -121
- package/dist/GoogleDriveOAuthModel/model.js +38 -51
- package/dist/GoogleDriveOAuthModel/model.js.map +1 -1
- package/dist/GoogleDriveOAuthModel/util.d.ts +1 -0
- package/dist/GoogleDriveOAuthModel/util.js +17 -0
- package/dist/GoogleDriveOAuthModel/util.js.map +1 -0
- package/dist/HTTPBasicModel/HTTPBasicLoginForm.d.ts +2 -1
- package/dist/HTTPBasicModel/HTTPBasicLoginForm.js +17 -21
- package/dist/HTTPBasicModel/HTTPBasicLoginForm.js.map +1 -1
- package/dist/HTTPBasicModel/model.d.ts +36 -4
- package/dist/HTTPBasicModel/model.js +24 -9
- package/dist/HTTPBasicModel/model.js.map +1 -1
- package/dist/OAuthModel/configSchema.d.ts +0 -8
- package/dist/OAuthModel/configSchema.js +1 -9
- package/dist/OAuthModel/configSchema.js.map +1 -1
- package/dist/OAuthModel/model.d.ts +103 -18
- package/dist/OAuthModel/model.js +165 -113
- package/dist/OAuthModel/model.js.map +1 -1
- package/dist/OAuthModel/util.d.ts +7 -0
- package/dist/OAuthModel/util.js +60 -0
- package/dist/OAuthModel/util.js.map +1 -0
- package/dist/index.d.ts +7 -433
- package/dist/util.d.ts +6 -0
- package/dist/util.js +23 -0
- package/dist/util.js.map +1 -0
- package/esm/DropboxOAuthModel/configSchema.d.ts +3 -14
- package/esm/DropboxOAuthModel/configSchema.js +0 -8
- package/esm/DropboxOAuthModel/configSchema.js.map +1 -1
- package/esm/DropboxOAuthModel/model.d.ts +35 -33
- package/esm/DropboxOAuthModel/model.js +26 -35
- package/esm/DropboxOAuthModel/model.js.map +1 -1
- package/esm/DropboxOAuthModel/util.d.ts +1 -0
- package/esm/DropboxOAuthModel/util.js +24 -0
- package/esm/DropboxOAuthModel/util.js.map +1 -0
- package/esm/ExternalTokenModel/ExternalTokenEntryForm.d.ts +2 -1
- package/esm/ExternalTokenModel/ExternalTokenEntryForm.js +10 -11
- package/esm/ExternalTokenModel/ExternalTokenEntryForm.js.map +1 -1
- package/esm/GoogleDriveOAuthModel/GoogleDriveFilehandle.d.ts +15 -0
- package/esm/GoogleDriveOAuthModel/GoogleDriveFilehandle.js +16 -0
- package/esm/GoogleDriveOAuthModel/GoogleDriveFilehandle.js.map +1 -0
- package/esm/GoogleDriveOAuthModel/configSchema.d.ts +0 -5
- package/esm/GoogleDriveOAuthModel/model.d.ts +36 -121
- package/esm/GoogleDriveOAuthModel/model.js +37 -49
- package/esm/GoogleDriveOAuthModel/model.js.map +1 -1
- package/esm/GoogleDriveOAuthModel/util.d.ts +1 -0
- package/esm/GoogleDriveOAuthModel/util.js +13 -0
- package/esm/GoogleDriveOAuthModel/util.js.map +1 -0
- package/esm/HTTPBasicModel/HTTPBasicLoginForm.d.ts +2 -1
- package/esm/HTTPBasicModel/HTTPBasicLoginForm.js +18 -22
- package/esm/HTTPBasicModel/HTTPBasicLoginForm.js.map +1 -1
- package/esm/HTTPBasicModel/model.d.ts +36 -4
- package/esm/HTTPBasicModel/model.js +24 -9
- package/esm/HTTPBasicModel/model.js.map +1 -1
- package/esm/OAuthModel/configSchema.d.ts +0 -8
- package/esm/OAuthModel/configSchema.js +1 -9
- package/esm/OAuthModel/configSchema.js.map +1 -1
- package/esm/OAuthModel/model.d.ts +103 -18
- package/esm/OAuthModel/model.js +164 -86
- package/esm/OAuthModel/model.js.map +1 -1
- package/esm/OAuthModel/util.d.ts +7 -0
- package/esm/OAuthModel/util.js +30 -0
- package/esm/OAuthModel/util.js.map +1 -0
- package/esm/index.d.ts +7 -433
- package/esm/util.d.ts +6 -0
- package/esm/util.js +18 -0
- package/esm/util.js.map +1 -0
- package/package.json +3 -4
- package/src/DropboxOAuthModel/configSchema.ts +0 -8
- package/src/DropboxOAuthModel/model.tsx +35 -54
- package/src/DropboxOAuthModel/util.ts +36 -0
- package/src/ExternalTokenModel/ExternalTokenEntryForm.tsx +39 -41
- package/src/GoogleDriveOAuthModel/GoogleDriveFilehandle.ts +38 -0
- package/src/GoogleDriveOAuthModel/model.tsx +54 -104
- package/src/GoogleDriveOAuthModel/util.ts +29 -0
- package/src/HTTPBasicModel/HTTPBasicLoginForm.tsx +53 -56
- package/src/HTTPBasicModel/model.tsx +26 -11
- package/src/OAuthModel/configSchema.ts +2 -9
- package/src/OAuthModel/model.tsx +190 -108
- package/src/OAuthModel/util.ts +33 -0
- package/src/util.ts +25 -0
|
@@ -2,7 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { UriLocation } from '@jbrowse/core/util/types';
|
|
3
3
|
import { SvgIconProps } from '@mui/material';
|
|
4
4
|
import { Instance } from 'mobx-state-tree';
|
|
5
|
-
export declare function DropboxIcon(props: SvgIconProps): JSX.Element;
|
|
5
|
+
export declare function DropboxIcon(props: SvgIconProps): React.JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* #stateModel DropboxOAuthInternetAccount
|
|
8
|
+
*/
|
|
6
9
|
declare const stateModelFactory: (configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
7
10
|
authEndpoint: {
|
|
8
11
|
description: string;
|
|
@@ -24,11 +27,6 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
24
27
|
type: string;
|
|
25
28
|
defaultValue: string[];
|
|
26
29
|
};
|
|
27
|
-
hasRefreshToken: {
|
|
28
|
-
description: string;
|
|
29
|
-
type: string;
|
|
30
|
-
defaultValue: boolean;
|
|
31
|
-
};
|
|
32
30
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
33
31
|
tokenType: {
|
|
34
32
|
description: string;
|
|
@@ -70,11 +68,6 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
70
68
|
type: string;
|
|
71
69
|
defaultValue: string;
|
|
72
70
|
};
|
|
73
|
-
hasRefreshToken: {
|
|
74
|
-
description: string;
|
|
75
|
-
type: string;
|
|
76
|
-
defaultValue: boolean;
|
|
77
|
-
};
|
|
78
71
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
79
72
|
name: {
|
|
80
73
|
description: string;
|
|
@@ -90,7 +83,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
90
83
|
description: string;
|
|
91
84
|
type: string;
|
|
92
85
|
defaultValue: string;
|
|
93
|
-
};
|
|
86
|
+
};
|
|
94
87
|
tokenType: {
|
|
95
88
|
description: string;
|
|
96
89
|
type: string;
|
|
@@ -121,7 +114,9 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
121
114
|
defaultValue: string;
|
|
122
115
|
};
|
|
123
116
|
tokenType: {
|
|
124
|
-
description: string;
|
|
117
|
+
description: string; /**
|
|
118
|
+
* #property
|
|
119
|
+
*/
|
|
125
120
|
type: string;
|
|
126
121
|
defaultValue: string;
|
|
127
122
|
};
|
|
@@ -174,11 +169,6 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
174
169
|
type: string;
|
|
175
170
|
defaultValue: string;
|
|
176
171
|
};
|
|
177
|
-
hasRefreshToken: {
|
|
178
|
-
description: string;
|
|
179
|
-
type: string;
|
|
180
|
-
defaultValue: boolean;
|
|
181
|
-
};
|
|
182
172
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
183
173
|
name: {
|
|
184
174
|
description: string;
|
|
@@ -194,7 +184,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
194
184
|
description: string;
|
|
195
185
|
type: string;
|
|
196
186
|
defaultValue: string;
|
|
197
|
-
};
|
|
187
|
+
};
|
|
198
188
|
tokenType: {
|
|
199
189
|
description: string;
|
|
200
190
|
type: string;
|
|
@@ -207,7 +197,13 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
207
197
|
};
|
|
208
198
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>;
|
|
209
199
|
} & {
|
|
200
|
+
/**
|
|
201
|
+
* #property
|
|
202
|
+
*/
|
|
210
203
|
type: import("mobx-state-tree").ISimpleType<"DropboxOAuthInternetAccount">;
|
|
204
|
+
/**
|
|
205
|
+
* #property
|
|
206
|
+
*/
|
|
211
207
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
212
208
|
authEndpoint: {
|
|
213
209
|
description: string;
|
|
@@ -229,11 +225,6 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
229
225
|
type: string;
|
|
230
226
|
defaultValue: string[];
|
|
231
227
|
};
|
|
232
|
-
hasRefreshToken: {
|
|
233
|
-
description: string;
|
|
234
|
-
type: string;
|
|
235
|
-
defaultValue: boolean;
|
|
236
|
-
};
|
|
237
228
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
238
229
|
tokenType: {
|
|
239
230
|
description: string;
|
|
@@ -275,11 +266,6 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
275
266
|
type: string;
|
|
276
267
|
defaultValue: string;
|
|
277
268
|
};
|
|
278
|
-
hasRefreshToken: {
|
|
279
|
-
description: string;
|
|
280
|
-
type: string;
|
|
281
|
-
defaultValue: boolean;
|
|
282
|
-
};
|
|
283
269
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
284
270
|
name: {
|
|
285
271
|
description: string;
|
|
@@ -295,7 +281,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
295
281
|
description: string;
|
|
296
282
|
type: string;
|
|
297
283
|
defaultValue: string;
|
|
298
|
-
};
|
|
284
|
+
};
|
|
299
285
|
tokenType: {
|
|
300
286
|
description: string;
|
|
301
287
|
type: string;
|
|
@@ -308,7 +294,9 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
308
294
|
};
|
|
309
295
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>, undefined>>;
|
|
310
296
|
}, {
|
|
311
|
-
readonly name: string;
|
|
297
|
+
readonly name: string; /**
|
|
298
|
+
* #getter
|
|
299
|
+
*/
|
|
312
300
|
readonly description: string;
|
|
313
301
|
readonly internetAccountId: string;
|
|
314
302
|
readonly authHeader: string;
|
|
@@ -365,7 +353,6 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
365
353
|
readonly scopes: string;
|
|
366
354
|
state(): string | undefined;
|
|
367
355
|
readonly responseType: "code" | "token";
|
|
368
|
-
readonly hasRefreshToken: boolean;
|
|
369
356
|
readonly refreshTokenKey: string;
|
|
370
357
|
} & {
|
|
371
358
|
storeRefreshToken(refreshToken: string): void;
|
|
@@ -381,10 +368,25 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
381
368
|
getTokenFromUser(resolve: (token: string) => void, reject: (error: Error) => void): Promise<void>;
|
|
382
369
|
validateToken(token: string, location: UriLocation): Promise<string>;
|
|
383
370
|
} & {
|
|
384
|
-
|
|
371
|
+
getFetcher(loc?: UriLocation | undefined): (input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
|
372
|
+
} & {
|
|
373
|
+
/**
|
|
374
|
+
* #getter
|
|
375
|
+
* The FileSelector icon for Dropbox
|
|
376
|
+
*/
|
|
377
|
+
readonly toggleContents: React.JSX.Element;
|
|
378
|
+
/**
|
|
379
|
+
* #getter
|
|
380
|
+
*/
|
|
385
381
|
readonly selectorLabel: string;
|
|
386
382
|
} & {
|
|
383
|
+
/**
|
|
384
|
+
* #method
|
|
385
|
+
*/
|
|
387
386
|
getFetcher(location?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
387
|
+
/**
|
|
388
|
+
* #action
|
|
389
|
+
*/
|
|
388
390
|
validateToken(token: string, location: UriLocation): Promise<string>;
|
|
389
391
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
390
392
|
export default stateModelFactory;
|
|
@@ -4,56 +4,46 @@ import { SvgIcon } from '@mui/material';
|
|
|
4
4
|
import { types } from 'mobx-state-tree';
|
|
5
5
|
import baseModel from '../OAuthModel/model';
|
|
6
6
|
import { configSchema as OAuthConfigSchema } from '../OAuthModel';
|
|
7
|
-
|
|
8
|
-
const dropboxErrorMessages = {
|
|
9
|
-
shared_link_not_found: "The shared link wasn't found.",
|
|
10
|
-
shared_link_access_denied: 'The caller is not allowed to access this shared link.',
|
|
11
|
-
unsupported_link_type: 'This type of link is not supported; use files/export instead.',
|
|
12
|
-
shared_link_is_directory: 'Directories cannot be retrieved by this endpoint.',
|
|
13
|
-
};
|
|
7
|
+
import { getDescriptiveErrorMessage } from './util';
|
|
14
8
|
export function DropboxIcon(props) {
|
|
15
9
|
return (React.createElement(SvgIcon, { ...props },
|
|
16
10
|
React.createElement("path", { d: "M3 6.2L8 9.39L13 6.2L8 3L3 6.2M13 6.2L18 9.39L23 6.2L18 3L13 6.2M3 12.55L8 15.74L13 12.55L8 9.35L3 12.55M18 9.35L13 12.55L18 15.74L23 12.55L18 9.35M8.03 16.8L13.04 20L18.04 16.8L13.04 13.61L8.03 16.8Z" })));
|
|
17
11
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
errorMessage = await response.text();
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
errorMessage = '';
|
|
25
|
-
}
|
|
26
|
-
if (errorMessage) {
|
|
27
|
-
let errorMessageParsed;
|
|
28
|
-
try {
|
|
29
|
-
errorMessageParsed = JSON.parse(errorMessage);
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
errorMessageParsed = undefined;
|
|
33
|
-
}
|
|
34
|
-
if (errorMessageParsed) {
|
|
35
|
-
const messageTag = errorMessageParsed.error['.tag'];
|
|
36
|
-
errorMessage = dropboxErrorMessages[messageTag] || messageTag;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return `Network response failure — ${response.status} (${response.statusText})${errorMessage ? ` (${errorMessage})` : ''}`;
|
|
40
|
-
}
|
|
12
|
+
/**
|
|
13
|
+
* #stateModel DropboxOAuthInternetAccount
|
|
14
|
+
*/
|
|
41
15
|
const stateModelFactory = (configSchema) => {
|
|
42
16
|
return baseModel(OAuthConfigSchema)
|
|
43
17
|
.named('DropboxOAuthInternetAccount')
|
|
44
18
|
.props({
|
|
19
|
+
/**
|
|
20
|
+
* #property
|
|
21
|
+
*/
|
|
45
22
|
type: types.literal('DropboxOAuthInternetAccount'),
|
|
23
|
+
/**
|
|
24
|
+
* #property
|
|
25
|
+
*/
|
|
46
26
|
configuration: ConfigurationReference(configSchema),
|
|
47
27
|
})
|
|
48
28
|
.views(() => ({
|
|
29
|
+
/**
|
|
30
|
+
* #getter
|
|
31
|
+
* The FileSelector icon for Dropbox
|
|
32
|
+
*/
|
|
49
33
|
get toggleContents() {
|
|
50
34
|
return React.createElement(DropboxIcon, null);
|
|
51
35
|
},
|
|
36
|
+
/**
|
|
37
|
+
* #getter
|
|
38
|
+
*/
|
|
52
39
|
get selectorLabel() {
|
|
53
40
|
return 'Enter Dropbox share link';
|
|
54
41
|
},
|
|
55
42
|
}))
|
|
56
43
|
.actions(self => ({
|
|
44
|
+
/**
|
|
45
|
+
* #method
|
|
46
|
+
*/
|
|
57
47
|
getFetcher(location) {
|
|
58
48
|
return async (input, init) => {
|
|
59
49
|
const authToken = await self.getToken(location);
|
|
@@ -61,12 +51,14 @@ const stateModelFactory = (configSchema) => {
|
|
|
61
51
|
newInit.headers.append('Dropbox-API-Arg', JSON.stringify({ url: input }));
|
|
62
52
|
const response = await fetch('https://content.dropboxapi.com/2/sharing/get_shared_link_file', newInit);
|
|
63
53
|
if (!response.ok) {
|
|
64
|
-
|
|
65
|
-
throw new Error(message);
|
|
54
|
+
throw new Error(await getDescriptiveErrorMessage(response));
|
|
66
55
|
}
|
|
67
56
|
return response;
|
|
68
57
|
};
|
|
69
58
|
},
|
|
59
|
+
/**
|
|
60
|
+
* #action
|
|
61
|
+
*/
|
|
70
62
|
async validateToken(token, location) {
|
|
71
63
|
const response = await fetch('https://api.dropboxapi.com/2/sharing/get_shared_link_metadata', {
|
|
72
64
|
method: 'POST',
|
|
@@ -79,14 +71,13 @@ const stateModelFactory = (configSchema) => {
|
|
|
79
71
|
}),
|
|
80
72
|
});
|
|
81
73
|
if (!response.ok) {
|
|
82
|
-
const refreshToken = self.
|
|
74
|
+
const refreshToken = self.retrieveRefreshToken();
|
|
83
75
|
if (refreshToken) {
|
|
84
76
|
self.removeRefreshToken();
|
|
85
77
|
const newToken = await self.exchangeRefreshForAccessToken(refreshToken);
|
|
86
78
|
return this.validateToken(newToken, location);
|
|
87
79
|
}
|
|
88
|
-
|
|
89
|
-
throw new Error(`Token could not be validated. ${message}`);
|
|
80
|
+
throw new Error(await getDescriptiveErrorMessage(response, 'Token could not be validated'));
|
|
90
81
|
}
|
|
91
82
|
return token;
|
|
92
83
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/DropboxOAuthModel/model.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,OAAO,EAAgB,OAAO,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAY,KAAK,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/DropboxOAuthModel/model.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getDescriptiveErrorMessage(response: Response, reason?: string): Promise<string>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getResponseError } from '../util';
|
|
2
|
+
/**
|
|
3
|
+
* Error messages from
|
|
4
|
+
* https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_file
|
|
5
|
+
* */
|
|
6
|
+
const dropboxErrorMessages = {
|
|
7
|
+
shared_link_not_found: "The shared link wasn't found.",
|
|
8
|
+
shared_link_access_denied: 'The caller is not allowed to access this shared link.',
|
|
9
|
+
unsupported_link_type: 'This type of link is not supported; use files/export instead.',
|
|
10
|
+
shared_link_is_directory: 'Directories cannot be retrieved by this endpoint.',
|
|
11
|
+
};
|
|
12
|
+
export async function getDescriptiveErrorMessage(response, reason) {
|
|
13
|
+
let errorMessage = '';
|
|
14
|
+
try {
|
|
15
|
+
const err = JSON.parse(await response.text());
|
|
16
|
+
const tag = err.error['.tag'];
|
|
17
|
+
errorMessage = dropboxErrorMessages[tag] || tag;
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
/* do nothing */
|
|
21
|
+
}
|
|
22
|
+
return getResponseError({ response, reason, statusText: errorMessage });
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/DropboxOAuthModel/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAS1C;;;KAGK;AACL,MAAM,oBAAoB,GAAuC;IAC/D,qBAAqB,EAAE,+BAA+B;IACtD,yBAAyB,EACvB,uDAAuD;IACzD,qBAAqB,EACnB,+DAA+D;IACjE,wBAAwB,EAAE,mDAAmD;CAC9E,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,QAAkB,EAClB,MAAe;IAEf,IAAI,YAAY,GAAG,EAAE,CAAA;IACrB,IAAI;QACF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAiB,CAAA;QAC7D,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAC7B,YAAY,GAAG,oBAAoB,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;KAChD;IAAC,OAAO,KAAK,EAAE;QACd,gBAAgB;KACjB;IACD,OAAO,gBAAgB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAA;AACzE,CAAC"}
|
|
@@ -3,16 +3,15 @@ import { Button, DialogContent, DialogActions, TextField } from '@mui/material';
|
|
|
3
3
|
import { Dialog } from '@jbrowse/core/ui';
|
|
4
4
|
export const ExternalTokenEntryForm = ({ internetAccountId, handleClose, }) => {
|
|
5
5
|
const [token, setToken] = useState('');
|
|
6
|
-
return (React.createElement(
|
|
7
|
-
React.createElement(
|
|
8
|
-
React.createElement(
|
|
9
|
-
|
|
10
|
-
React.createElement(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
React.createElement(Button, { variant: "contained", color: "primary", onClick: () => handleClose() }, "Cancel")))));
|
|
6
|
+
return (React.createElement(Dialog, { open: true, maxWidth: "xl", "data-testid": "externalToken-form", title: `Enter token for ${internetAccountId}` },
|
|
7
|
+
React.createElement(DialogContent, { style: { display: 'flex', flexDirection: 'column' } },
|
|
8
|
+
React.createElement(TextField, { required: true, label: "Enter Token", variant: "outlined", inputProps: { 'data-testid': 'entry-externalToken' }, onChange: event => setToken(event.target.value), margin: "dense" })),
|
|
9
|
+
React.createElement(DialogActions, null,
|
|
10
|
+
React.createElement(Button, { variant: "contained", color: "primary", type: "submit", disabled: !token, onClick: () => {
|
|
11
|
+
if (token) {
|
|
12
|
+
handleClose(token);
|
|
13
|
+
}
|
|
14
|
+
} }, "Add"),
|
|
15
|
+
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel"))));
|
|
17
16
|
};
|
|
18
17
|
//# sourceMappingURL=ExternalTokenEntryForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalTokenEntryForm.js","sourceRoot":"","sources":["../../src/ExternalTokenModel/ExternalTokenEntryForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,iBAAiB,EACjB,WAAW,GAIZ,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEtC,OAAO,CACL
|
|
1
|
+
{"version":3,"file":"ExternalTokenEntryForm.js","sourceRoot":"","sources":["../../src/ExternalTokenModel/ExternalTokenEntryForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,iBAAiB,EACjB,WAAW,GAIZ,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEtC,OAAO,CACL,oBAAC,MAAM,IACL,IAAI,QACJ,QAAQ,EAAC,IAAI,iBACD,oBAAoB,EAChC,KAAK,EAAE,mBAAmB,iBAAiB,EAAE;QAE7C,oBAAC,aAAa,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE;YAChE,oBAAC,SAAS,IACR,QAAQ,QACR,KAAK,EAAC,aAAa,EACnB,OAAO,EAAC,UAAU,EAClB,UAAU,EAAE,EAAE,aAAa,EAAE,qBAAqB,EAAE,EACpD,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,MAAM,EAAC,OAAO,GACd,CACY;QAChB,oBAAC,aAAa;YACZ,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,EACf,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,KAAK,EAChB,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,KAAK,EAAE;wBACT,WAAW,CAAC,KAAK,CAAC,CAAA;qBACnB;gBACH,CAAC,UAGM;YACT,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,aAGrB,CACK,CACT,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RemoteFileWithRangeCache } from '@jbrowse/core/util/io';
|
|
2
|
+
import { FilehandleOptions, Stats, PolyfilledResponse } from 'generic-filehandle';
|
|
3
|
+
export interface RequestInitWithMetadata extends RequestInit {
|
|
4
|
+
metadataOnly?: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface GoogleDriveFilehandleOptions extends FilehandleOptions {
|
|
7
|
+
fetch(input: RequestInfo, opts?: RequestInitWithMetadata): Promise<PolyfilledResponse>;
|
|
8
|
+
}
|
|
9
|
+
export declare class GoogleDriveFile extends RemoteFileWithRangeCache {
|
|
10
|
+
private statsPromise;
|
|
11
|
+
constructor(source: string, opts: GoogleDriveFilehandleOptions);
|
|
12
|
+
fetch(input: RequestInfo, opts?: RequestInitWithMetadata): Promise<PolyfilledResponse>;
|
|
13
|
+
stat(): Promise<Stats>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RemoteFileWithRangeCache } from '@jbrowse/core/util/io';
|
|
2
|
+
export class GoogleDriveFile extends RemoteFileWithRangeCache {
|
|
3
|
+
constructor(source, opts) {
|
|
4
|
+
super(source, opts);
|
|
5
|
+
this.statsPromise = this.fetch(source, {
|
|
6
|
+
metadataOnly: true,
|
|
7
|
+
}).then((response) => response.json());
|
|
8
|
+
}
|
|
9
|
+
async fetch(input, opts) {
|
|
10
|
+
return super.fetch(input, opts);
|
|
11
|
+
}
|
|
12
|
+
async stat() {
|
|
13
|
+
return this.statsPromise;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=GoogleDriveFilehandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleDriveFilehandle.js","sourceRoot":"","sources":["../../src/GoogleDriveOAuthModel/GoogleDriveFilehandle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAkBhE,MAAM,OAAO,eAAgB,SAAQ,wBAAwB;IAE3D,YAAY,MAAc,EAAE,IAAkC;QAC5D,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YACrC,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC,IAAI,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IAClD,CAAC;IAED,KAAK,CAAC,KAAK,CACT,KAAkB,EAClB,IAA8B;QAE9B,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;CACF"}
|
|
@@ -75,11 +75,6 @@ declare const GoogleDriveOAuthConfigSchema: import("@jbrowse/core/configuration/
|
|
|
75
75
|
type: string;
|
|
76
76
|
defaultValue: string;
|
|
77
77
|
};
|
|
78
|
-
hasRefreshToken: {
|
|
79
|
-
description: string;
|
|
80
|
-
type: string;
|
|
81
|
-
defaultValue: boolean;
|
|
82
|
-
};
|
|
83
78
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
84
79
|
name: {
|
|
85
80
|
description: string;
|
|
@@ -1,114 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Instance } from 'mobx-state-tree';
|
|
3
|
-
import { RemoteFileWithRangeCache } from '@jbrowse/core/util/io';
|
|
4
3
|
import { UriLocation } from '@jbrowse/core/util/types';
|
|
5
|
-
import {
|
|
4
|
+
import { GoogleDriveOAuthInternetAccountConfigModel } from './configSchema';
|
|
5
|
+
import { GoogleDriveFile } from './GoogleDriveFilehandle';
|
|
6
6
|
export interface RequestInitWithMetadata extends RequestInit {
|
|
7
7
|
metadataOnly?: boolean;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
private statsPromise;
|
|
14
|
-
constructor(source: string, opts: GoogleDriveFilehandleOptions);
|
|
15
|
-
fetch(input: RequestInfo, opts?: RequestInitWithMetadata): Promise<PolyfilledResponse>;
|
|
16
|
-
stat(): Promise<Stats>;
|
|
17
|
-
}
|
|
18
|
-
declare const stateModelFactory: (configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
19
|
-
authEndpoint: {
|
|
20
|
-
description: string;
|
|
21
|
-
type: string;
|
|
22
|
-
defaultValue: string;
|
|
23
|
-
};
|
|
24
|
-
scopes: {
|
|
25
|
-
description: string;
|
|
26
|
-
type: string;
|
|
27
|
-
defaultValue: string;
|
|
28
|
-
};
|
|
29
|
-
domains: {
|
|
30
|
-
description: string;
|
|
31
|
-
type: string;
|
|
32
|
-
defaultValue: string[];
|
|
33
|
-
};
|
|
34
|
-
responseType: {
|
|
35
|
-
description: string;
|
|
36
|
-
type: string;
|
|
37
|
-
defaultValue: string;
|
|
38
|
-
};
|
|
39
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
40
|
-
tokenType: {
|
|
41
|
-
description: string;
|
|
42
|
-
type: string;
|
|
43
|
-
defaultValue: string;
|
|
44
|
-
};
|
|
45
|
-
authEndpoint: {
|
|
46
|
-
description: string;
|
|
47
|
-
type: string;
|
|
48
|
-
defaultValue: string;
|
|
49
|
-
};
|
|
50
|
-
tokenEndpoint: {
|
|
51
|
-
description: string;
|
|
52
|
-
type: string;
|
|
53
|
-
defaultValue: string;
|
|
54
|
-
};
|
|
55
|
-
needsPKCE: {
|
|
56
|
-
description: string;
|
|
57
|
-
type: string;
|
|
58
|
-
defaultValue: boolean;
|
|
59
|
-
};
|
|
60
|
-
clientId: {
|
|
61
|
-
description: string;
|
|
62
|
-
type: string;
|
|
63
|
-
defaultValue: string;
|
|
64
|
-
};
|
|
65
|
-
scopes: {
|
|
66
|
-
description: string;
|
|
67
|
-
type: string;
|
|
68
|
-
defaultValue: string;
|
|
69
|
-
};
|
|
70
|
-
state: {
|
|
71
|
-
description: string;
|
|
72
|
-
type: string;
|
|
73
|
-
defaultValue: string;
|
|
74
|
-
};
|
|
75
|
-
responseType: {
|
|
76
|
-
description: string;
|
|
77
|
-
type: string;
|
|
78
|
-
defaultValue: string;
|
|
79
|
-
};
|
|
80
|
-
hasRefreshToken: {
|
|
81
|
-
description: string;
|
|
82
|
-
type: string;
|
|
83
|
-
defaultValue: boolean;
|
|
84
|
-
};
|
|
85
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
86
|
-
name: {
|
|
87
|
-
description: string;
|
|
88
|
-
type: string;
|
|
89
|
-
defaultValue: string;
|
|
90
|
-
};
|
|
91
|
-
description: {
|
|
92
|
-
description: string;
|
|
93
|
-
type: string;
|
|
94
|
-
defaultValue: string;
|
|
95
|
-
};
|
|
96
|
-
authHeader: {
|
|
97
|
-
description: string;
|
|
98
|
-
type: string;
|
|
99
|
-
defaultValue: string;
|
|
100
|
-
};
|
|
101
|
-
tokenType: {
|
|
102
|
-
description: string;
|
|
103
|
-
type: string;
|
|
104
|
-
defaultValue: string;
|
|
105
|
-
};
|
|
106
|
-
domains: {
|
|
107
|
-
description: string;
|
|
108
|
-
type: string;
|
|
109
|
-
defaultValue: never[];
|
|
110
|
-
};
|
|
111
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>, undefined>>) => import("mobx-state-tree").IModelType<{
|
|
9
|
+
/**
|
|
10
|
+
* #stateModel GoogleDriveOAuthInternetAccount
|
|
11
|
+
*/
|
|
12
|
+
export default function stateModelFactory(configSchema: GoogleDriveOAuthInternetAccountConfigModel): import("mobx-state-tree").IModelType<{
|
|
112
13
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
113
14
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
114
15
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
@@ -181,11 +82,6 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
181
82
|
type: string;
|
|
182
83
|
defaultValue: string;
|
|
183
84
|
};
|
|
184
|
-
hasRefreshToken: {
|
|
185
|
-
description: string;
|
|
186
|
-
type: string;
|
|
187
|
-
defaultValue: boolean;
|
|
188
|
-
};
|
|
189
85
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
190
86
|
name: {
|
|
191
87
|
description: string;
|
|
@@ -214,7 +110,13 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
214
110
|
};
|
|
215
111
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>;
|
|
216
112
|
} & {
|
|
113
|
+
/**
|
|
114
|
+
* #property
|
|
115
|
+
*/
|
|
217
116
|
type: import("mobx-state-tree").ISimpleType<"GoogleDriveOAuthInternetAccount">;
|
|
117
|
+
/**
|
|
118
|
+
* #property
|
|
119
|
+
*/
|
|
218
120
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
219
121
|
authEndpoint: {
|
|
220
122
|
description: string;
|
|
@@ -277,11 +179,6 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
277
179
|
type: string;
|
|
278
180
|
defaultValue: string;
|
|
279
181
|
};
|
|
280
|
-
hasRefreshToken: {
|
|
281
|
-
description: string;
|
|
282
|
-
type: string;
|
|
283
|
-
defaultValue: boolean;
|
|
284
|
-
};
|
|
285
182
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
286
183
|
name: {
|
|
287
184
|
description: string;
|
|
@@ -356,18 +253,19 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
356
253
|
} & {
|
|
357
254
|
getFetcher(loc?: UriLocation | undefined): (input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
|
358
255
|
} & {
|
|
359
|
-
openLocation(location: UriLocation): RemoteFileWithRangeCache;
|
|
256
|
+
openLocation(location: UriLocation): import("@jbrowse/core/util/io").RemoteFileWithRangeCache;
|
|
360
257
|
} & {
|
|
361
258
|
readonly codeVerifierPKCE: string;
|
|
362
259
|
} & {
|
|
363
260
|
readonly authEndpoint: string;
|
|
364
|
-
readonly tokenEndpoint: string;
|
|
261
|
+
readonly tokenEndpoint: string; /**
|
|
262
|
+
* #method
|
|
263
|
+
*/
|
|
365
264
|
readonly needsPKCE: boolean;
|
|
366
265
|
readonly clientId: string;
|
|
367
266
|
readonly scopes: string;
|
|
368
267
|
state(): string | undefined;
|
|
369
268
|
readonly responseType: "code" | "token";
|
|
370
|
-
readonly hasRefreshToken: boolean;
|
|
371
269
|
readonly refreshTokenKey: string;
|
|
372
270
|
} & {
|
|
373
271
|
storeRefreshToken(refreshToken: string): void;
|
|
@@ -383,13 +281,30 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
383
281
|
getTokenFromUser(resolve: (token: string) => void, reject: (error: Error) => void): Promise<void>;
|
|
384
282
|
validateToken(token: string, location: UriLocation): Promise<string>;
|
|
385
283
|
} & {
|
|
386
|
-
|
|
284
|
+
getFetcher(loc?: UriLocation | undefined): (input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
|
285
|
+
} & {
|
|
286
|
+
/**
|
|
287
|
+
* #getter
|
|
288
|
+
* The FileSelector icon for Google drive
|
|
289
|
+
*/
|
|
290
|
+
readonly toggleContents: React.JSX.Element;
|
|
291
|
+
/**
|
|
292
|
+
* #getter
|
|
293
|
+
*/
|
|
387
294
|
readonly selectorLabel: string;
|
|
388
295
|
} & {
|
|
389
|
-
|
|
296
|
+
/**
|
|
297
|
+
* #method
|
|
298
|
+
*/
|
|
299
|
+
getFetcher(location?: UriLocation): (input: RequestInfo, init?: RequestInitWithMetadata) => Promise<Response>;
|
|
300
|
+
/**
|
|
301
|
+
* #method
|
|
302
|
+
*/
|
|
390
303
|
openLocation(location: UriLocation): GoogleDriveFile;
|
|
304
|
+
/**
|
|
305
|
+
* #action
|
|
306
|
+
*/
|
|
391
307
|
validateToken(token: string, location: UriLocation): Promise<string>;
|
|
392
308
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
393
|
-
export default stateModelFactory;
|
|
394
309
|
export type GoogleDriveOAuthStateModel = ReturnType<typeof stateModelFactory>;
|
|
395
310
|
export type GoogleDriveOAuthModel = Instance<GoogleDriveOAuthStateModel>;
|