@jbrowse/plugin-authentication 2.17.0 → 2.18.0

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.
Files changed (60) hide show
  1. package/dist/DropboxOAuthModel/DropboxIcon.d.ts +1 -1
  2. package/dist/DropboxOAuthModel/configSchema.d.ts +1 -13
  3. package/dist/DropboxOAuthModel/configSchema.js +1 -19
  4. package/dist/DropboxOAuthModel/model.d.ts +3 -25
  5. package/dist/DropboxOAuthModel/model.js +2 -24
  6. package/dist/DropboxOAuthModel/util.js +0 -5
  7. package/dist/ExternalTokenModel/ExternalTokenEntryForm.js +4 -2
  8. package/dist/ExternalTokenModel/configSchema.d.ts +1 -4
  9. package/dist/ExternalTokenModel/configSchema.js +1 -10
  10. package/dist/ExternalTokenModel/model.d.ts +3 -3
  11. package/dist/GoogleDriveOAuthModel/GoogleDriveFilehandle.d.ts +1 -1
  12. package/dist/GoogleDriveOAuthModel/GoogleDriveIcon.d.ts +1 -1
  13. package/dist/GoogleDriveOAuthModel/configSchema.d.ts +1 -13
  14. package/dist/GoogleDriveOAuthModel/configSchema.js +1 -19
  15. package/dist/GoogleDriveOAuthModel/model.d.ts +3 -28
  16. package/dist/GoogleDriveOAuthModel/model.js +2 -27
  17. package/dist/GoogleDriveOAuthModel/util.js +0 -1
  18. package/dist/HTTPBasicModel/HTTPBasicLoginForm.js +4 -2
  19. package/dist/HTTPBasicModel/configSchema.d.ts +1 -7
  20. package/dist/HTTPBasicModel/configSchema.js +1 -13
  21. package/dist/HTTPBasicModel/model.d.ts +3 -21
  22. package/dist/HTTPBasicModel/model.js +0 -18
  23. package/dist/OAuthModel/configSchema.d.ts +1 -25
  24. package/dist/OAuthModel/configSchema.js +1 -31
  25. package/dist/OAuthModel/model.d.ts +3 -89
  26. package/dist/OAuthModel/model.js +1 -96
  27. package/dist/OAuthModel/util.js +0 -2
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +3 -3
  30. package/esm/DropboxOAuthModel/DropboxIcon.d.ts +1 -1
  31. package/esm/DropboxOAuthModel/configSchema.d.ts +1 -13
  32. package/esm/DropboxOAuthModel/configSchema.js +1 -19
  33. package/esm/DropboxOAuthModel/model.d.ts +3 -25
  34. package/esm/DropboxOAuthModel/model.js +2 -24
  35. package/esm/DropboxOAuthModel/util.js +0 -5
  36. package/esm/ExternalTokenModel/ExternalTokenEntryForm.js +4 -2
  37. package/esm/ExternalTokenModel/configSchema.d.ts +1 -4
  38. package/esm/ExternalTokenModel/configSchema.js +1 -10
  39. package/esm/ExternalTokenModel/model.d.ts +3 -3
  40. package/esm/ExternalTokenModel/model.js +1 -1
  41. package/esm/GoogleDriveOAuthModel/GoogleDriveFilehandle.d.ts +1 -1
  42. package/esm/GoogleDriveOAuthModel/GoogleDriveIcon.d.ts +1 -1
  43. package/esm/GoogleDriveOAuthModel/configSchema.d.ts +1 -13
  44. package/esm/GoogleDriveOAuthModel/configSchema.js +1 -19
  45. package/esm/GoogleDriveOAuthModel/model.d.ts +3 -28
  46. package/esm/GoogleDriveOAuthModel/model.js +2 -27
  47. package/esm/GoogleDriveOAuthModel/util.js +0 -1
  48. package/esm/HTTPBasicModel/HTTPBasicLoginForm.js +4 -2
  49. package/esm/HTTPBasicModel/configSchema.d.ts +1 -7
  50. package/esm/HTTPBasicModel/configSchema.js +1 -13
  51. package/esm/HTTPBasicModel/model.d.ts +3 -21
  52. package/esm/HTTPBasicModel/model.js +1 -19
  53. package/esm/OAuthModel/configSchema.d.ts +1 -25
  54. package/esm/OAuthModel/configSchema.js +1 -31
  55. package/esm/OAuthModel/model.d.ts +3 -89
  56. package/esm/OAuthModel/model.js +1 -96
  57. package/esm/OAuthModel/util.js +0 -2
  58. package/esm/index.d.ts +1 -1
  59. package/esm/index.js +3 -3
  60. package/package.json +2 -2
@@ -1,10 +1,7 @@
1
1
  import React from 'react';
2
- import { UriLocation } from '@jbrowse/core/util/types';
3
- import { Instance } from 'mobx-state-tree';
4
- import { DropboxOAuthInternetAccountConfigModel } from './configSchema';
5
- /**
6
- * #stateModel DropboxOAuthInternetAccount
7
- */
2
+ import type { DropboxOAuthInternetAccountConfigModel } from './configSchema';
3
+ import type { UriLocation } from '@jbrowse/core/util/types';
4
+ import type { Instance } from 'mobx-state-tree';
8
5
  declare const stateModelFactory: (configSchema: DropboxOAuthInternetAccountConfigModel) => import("mobx-state-tree").IModelType<{
9
6
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
10
7
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -106,13 +103,7 @@ declare const stateModelFactory: (configSchema: DropboxOAuthInternetAccountConfi
106
103
  };
107
104
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>;
108
105
  } & {
109
- /**
110
- * #property
111
- */
112
106
  type: import("mobx-state-tree").ISimpleType<"DropboxOAuthInternetAccount">;
113
- /**
114
- * #property
115
- */
116
107
  configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
117
108
  authEndpoint: {
118
109
  description: string;
@@ -278,23 +269,10 @@ declare const stateModelFactory: (configSchema: DropboxOAuthInternetAccountConfi
278
269
  } & {
279
270
  getFetcher(loc?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
280
271
  } & {
281
- /**
282
- * #getter
283
- * The FileSelector icon for Dropbox
284
- */
285
272
  readonly toggleContents: React.JSX.Element;
286
- /**
287
- * #getter
288
- */
289
273
  readonly selectorLabel: string;
290
274
  } & {
291
- /**
292
- * #method
293
- */
294
275
  getFetcher(location?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
295
- /**
296
- * #action
297
- */
298
276
  validateToken(token: string, location: UriLocation): Promise<string>;
299
277
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
300
278
  export default stateModelFactory;
@@ -1,45 +1,26 @@
1
1
  import React from 'react';
2
2
  import { ConfigurationReference } from '@jbrowse/core/configuration';
3
3
  import { types } from 'mobx-state-tree';
4
- import baseModel from '../OAuthModel/model';
5
4
  import { configSchema as OAuthConfigSchema } from '../OAuthModel';
6
- import { getDescriptiveErrorMessage } from './util';
7
5
  import DropboxIcon from './DropboxIcon';
8
- /**
9
- * #stateModel DropboxOAuthInternetAccount
10
- */
6
+ import { getDescriptiveErrorMessage } from './util';
7
+ import baseModel from '../OAuthModel/model';
11
8
  const stateModelFactory = (configSchema) => {
12
9
  return baseModel(OAuthConfigSchema)
13
10
  .named('DropboxOAuthInternetAccount')
14
11
  .props({
15
- /**
16
- * #property
17
- */
18
12
  type: types.literal('DropboxOAuthInternetAccount'),
19
- /**
20
- * #property
21
- */
22
13
  configuration: ConfigurationReference(configSchema),
23
14
  })
24
15
  .views(() => ({
25
- /**
26
- * #getter
27
- * The FileSelector icon for Dropbox
28
- */
29
16
  get toggleContents() {
30
17
  return React.createElement(DropboxIcon, null);
31
18
  },
32
- /**
33
- * #getter
34
- */
35
19
  get selectorLabel() {
36
20
  return 'Enter Dropbox share link';
37
21
  },
38
22
  }))
39
23
  .actions(self => ({
40
- /**
41
- * #method
42
- */
43
24
  getFetcher(location) {
44
25
  return async (input, init) => {
45
26
  const authToken = await self.getToken(location);
@@ -52,9 +33,6 @@ const stateModelFactory = (configSchema) => {
52
33
  return response;
53
34
  };
54
35
  },
55
- /**
56
- * #action
57
- */
58
36
  async validateToken(token, location) {
59
37
  const response = await fetch('https://api.dropboxapi.com/2/sharing/get_shared_link_metadata', {
60
38
  method: 'POST',
@@ -1,8 +1,4 @@
1
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
2
  const dropboxErrorMessages = {
7
3
  shared_link_not_found: "The shared link wasn't found.",
8
4
  shared_link_access_denied: 'The caller is not allowed to access this shared link.',
@@ -17,7 +13,6 @@ export async function getDescriptiveErrorMessage(response, reason) {
17
13
  errorMessage = dropboxErrorMessages[tag] || tag;
18
14
  }
19
15
  catch (error) {
20
- /* do nothing */
21
16
  }
22
17
  return getResponseError({ response, reason, statusText: errorMessage });
23
18
  }
@@ -1,9 +1,11 @@
1
1
  import React, { useState } from 'react';
2
- import { Button, DialogContent, DialogActions, TextField } from '@mui/material';
3
2
  import { Dialog } from '@jbrowse/core/ui';
3
+ import { Button, DialogActions, DialogContent, TextField } from '@mui/material';
4
4
  export const ExternalTokenEntryForm = ({ internetAccountId, handleClose, }) => {
5
5
  const [token, setToken] = useState('');
6
- return (React.createElement(Dialog, { open: true, maxWidth: "xl", "data-testid": "externalToken-form", title: `Enter token for ${internetAccountId}` },
6
+ return (React.createElement(Dialog, { open: true, maxWidth: "xl", "data-testid": "externalToken-form", onClose: () => {
7
+ handleClose();
8
+ }, title: `Enter token for ${internetAccountId}` },
7
9
  React.createElement(DialogContent, { style: { display: 'flex', flexDirection: 'column' } },
8
10
  React.createElement(TextField, { required: true, label: "Enter Token", variant: "outlined", onChange: event => {
9
11
  setToken(event.target.value);
@@ -1,8 +1,5 @@
1
- import { Instance } from 'mobx-state-tree';
1
+ import type { Instance } from 'mobx-state-tree';
2
2
  declare const ExternalTokenConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
3
- /**
4
- * #slot
5
- */
6
3
  validateWithHEAD: {
7
4
  description: string;
8
5
  type: string;
@@ -1,22 +1,13 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
2
  import { BaseInternetAccountConfig } from '@jbrowse/core/pluggableElementTypes/models';
3
- /**
4
- * #config ExternalTokenInternetAccount
5
- */
6
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ function x() { }
7
4
  const ExternalTokenConfigSchema = ConfigurationSchema('ExternalTokenInternetAccount', {
8
- /**
9
- * #slot
10
- */
11
5
  validateWithHEAD: {
12
6
  description: 'validate the token with a HEAD request before using it',
13
7
  type: 'boolean',
14
8
  defaultValue: true,
15
9
  },
16
10
  }, {
17
- /**
18
- * #baseConfiguration
19
- */
20
11
  baseConfiguration: BaseInternetAccountConfig,
21
12
  explicitlyTyped: true,
22
13
  });
@@ -1,6 +1,6 @@
1
- import { UriLocation } from '@jbrowse/core/util/types';
2
- import { ExternalTokenInternetAccountConfigModel } from './configSchema';
3
- import { Instance } from 'mobx-state-tree';
1
+ import type { ExternalTokenInternetAccountConfigModel } from './configSchema';
2
+ import type { UriLocation } from '@jbrowse/core/util/types';
3
+ import type { Instance } from 'mobx-state-tree';
4
4
  declare const stateModelFactory: (configSchema: ExternalTokenInternetAccountConfigModel) => import("mobx-state-tree").IModelType<{
5
5
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
6
6
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -1,6 +1,6 @@
1
1
  import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
2
2
  import { InternetAccount } from '@jbrowse/core/pluggableElementTypes/models';
3
- import { types, getRoot } from 'mobx-state-tree';
3
+ import { getRoot, types } from 'mobx-state-tree';
4
4
  import { ExternalTokenEntryForm } from './ExternalTokenEntryForm';
5
5
  const stateModelFactory = (configSchema) => {
6
6
  return InternetAccount.named('ExternalTokenInternetAccount')
@@ -1,5 +1,5 @@
1
1
  import { RemoteFileWithRangeCache } from '@jbrowse/core/util/io';
2
- import { FilehandleOptions, Stats, PolyfilledResponse } from 'generic-filehandle';
2
+ import type { FilehandleOptions, PolyfilledResponse, Stats } from 'generic-filehandle';
3
3
  export interface RequestInitWithMetadata extends RequestInit {
4
4
  metadataOnly?: boolean;
5
5
  }
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { SvgIconProps } from '@mui/material';
2
+ import type { SvgIconProps } from '@mui/material';
3
3
  export default function GoogleDriveIcon(props: SvgIconProps): React.JSX.Element;
@@ -1,32 +1,20 @@
1
- import { Instance } from 'mobx-state-tree';
1
+ import type { Instance } from 'mobx-state-tree';
2
2
  declare const GoogleDriveOAuthConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
3
- /**
4
- * #slot
5
- */
6
3
  authEndpoint: {
7
4
  description: string;
8
5
  type: string;
9
6
  defaultValue: string;
10
7
  };
11
- /**
12
- * #slot
13
- */
14
8
  scopes: {
15
9
  description: string;
16
10
  type: string;
17
11
  defaultValue: string;
18
12
  };
19
- /**
20
- * #slot
21
- */
22
13
  domains: {
23
14
  description: string;
24
15
  type: string;
25
16
  defaultValue: string[];
26
17
  };
27
- /**
28
- * #slot
29
- */
30
18
  responseType: {
31
19
  description: string;
32
20
  type: string;
@@ -1,46 +1,28 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
2
  import OAuthConfigSchema from '../OAuthModel/configSchema';
3
- /**
4
- * #config GoogleDriveOAuthInternetAccount
5
- */
6
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ function x() { }
7
4
  const GoogleDriveOAuthConfigSchema = ConfigurationSchema('GoogleDriveOAuthInternetAccount', {
8
- /**
9
- * #slot
10
- */
11
5
  authEndpoint: {
12
6
  description: 'the authorization code endpoint of the internet account',
13
7
  type: 'string',
14
8
  defaultValue: 'https://accounts.google.com/o/oauth2/v2/auth',
15
9
  },
16
- /**
17
- * #slot
18
- */
19
10
  scopes: {
20
11
  description: 'optional scopes for the authorization call',
21
12
  type: 'string',
22
13
  defaultValue: 'https://www.googleapis.com/auth/drive.readonly',
23
14
  },
24
- /**
25
- * #slot
26
- */
27
15
  domains: {
28
16
  description: 'array of valid domains the url can contain to use this account',
29
17
  type: 'stringArray',
30
18
  defaultValue: ['drive.google.com"'],
31
19
  },
32
- /**
33
- * #slot
34
- */
35
20
  responseType: {
36
21
  description: 'the type of response from the authorization endpoint',
37
22
  type: 'string',
38
23
  defaultValue: 'token',
39
24
  },
40
25
  }, {
41
- /**
42
- * #baseConfiguration
43
- */
44
26
  baseConfiguration: OAuthConfigSchema,
45
27
  explicitlyTyped: true,
46
28
  });
@@ -1,14 +1,11 @@
1
1
  import React from 'react';
2
- import { Instance } from 'mobx-state-tree';
3
- import { UriLocation } from '@jbrowse/core/util/types';
4
- import { GoogleDriveOAuthInternetAccountConfigModel } from './configSchema';
5
2
  import { GoogleDriveFile } from './GoogleDriveFilehandle';
3
+ import type { GoogleDriveOAuthInternetAccountConfigModel } from './configSchema';
4
+ import type { UriLocation } from '@jbrowse/core/util/types';
5
+ import type { Instance } from 'mobx-state-tree';
6
6
  export interface RequestInitWithMetadata extends RequestInit {
7
7
  metadataOnly?: boolean;
8
8
  }
9
- /**
10
- * #stateModel GoogleDriveOAuthInternetAccount
11
- */
12
9
  export default function stateModelFactory(configSchema: GoogleDriveOAuthInternetAccountConfigModel): import("mobx-state-tree").IModelType<{
13
10
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
14
11
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -110,13 +107,7 @@ export default function stateModelFactory(configSchema: GoogleDriveOAuthInternet
110
107
  };
111
108
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>;
112
109
  } & {
113
- /**
114
- * #property
115
- */
116
110
  type: import("mobx-state-tree").ISimpleType<"GoogleDriveOAuthInternetAccount">;
117
- /**
118
- * #property
119
- */
120
111
  configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
121
112
  authEndpoint: {
122
113
  description: string;
@@ -282,27 +273,11 @@ export default function stateModelFactory(configSchema: GoogleDriveOAuthInternet
282
273
  } & {
283
274
  getFetcher(loc?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
284
275
  } & {
285
- /**
286
- * #getter
287
- * The FileSelector icon for Google drive
288
- */
289
276
  readonly toggleContents: React.JSX.Element;
290
- /**
291
- * #getter
292
- */
293
277
  readonly selectorLabel: string;
294
278
  } & {
295
- /**
296
- * #method
297
- */
298
279
  getFetcher(location?: UriLocation): (input: RequestInfo, init?: RequestInitWithMetadata) => Promise<Response>;
299
- /**
300
- * #method
301
- */
302
280
  openLocation(location: UriLocation): GoogleDriveFile;
303
- /**
304
- * #action
305
- */
306
281
  validateToken(token: string, location: UriLocation): Promise<string>;
307
282
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
308
283
  export type GoogleDriveOAuthStateModel = ReturnType<typeof stateModelFactory>;
@@ -1,50 +1,31 @@
1
1
  import React from 'react';
2
2
  import { ConfigurationReference } from '@jbrowse/core/configuration';
3
3
  import { types } from 'mobx-state-tree';
4
- import baseModel from '../OAuthModel/model';
5
4
  import { configSchema as OAuthConfigSchema } from '../OAuthModel';
6
- import { getDescriptiveErrorMessage } from './util';
7
5
  import { GoogleDriveFile } from './GoogleDriveFilehandle';
8
6
  import GoogleDriveIcon from './GoogleDriveIcon';
7
+ import { getDescriptiveErrorMessage } from './util';
8
+ import baseModel from '../OAuthModel/model';
9
9
  function getUri(str) {
10
10
  const urlId = /[-\w]{25,}/.exec(str);
11
11
  return `https://www.googleapis.com/drive/v3/files/${urlId}`;
12
12
  }
13
- /**
14
- * #stateModel GoogleDriveOAuthInternetAccount
15
- */
16
13
  export default function stateModelFactory(configSchema) {
17
14
  return baseModel(OAuthConfigSchema)
18
15
  .named('GoogleDriveOAuthInternetAccount')
19
16
  .props({
20
- /**
21
- * #property
22
- */
23
17
  type: types.literal('GoogleDriveOAuthInternetAccount'),
24
- /**
25
- * #property
26
- */
27
18
  configuration: ConfigurationReference(configSchema),
28
19
  })
29
20
  .views(() => ({
30
- /**
31
- * #getter
32
- * The FileSelector icon for Google drive
33
- */
34
21
  get toggleContents() {
35
22
  return React.createElement(GoogleDriveIcon, null);
36
23
  },
37
- /**
38
- * #getter
39
- */
40
24
  get selectorLabel() {
41
25
  return 'Enter Google Drive share link';
42
26
  },
43
27
  }))
44
28
  .actions(self => ({
45
- /**
46
- * #method
47
- */
48
29
  getFetcher(location) {
49
30
  return async (input, init) => {
50
31
  const driveUrl = new URL(getUri(String(input)));
@@ -64,17 +45,11 @@ export default function stateModelFactory(configSchema) {
64
45
  return response;
65
46
  };
66
47
  },
67
- /**
68
- * #method
69
- */
70
48
  openLocation(location) {
71
49
  return new GoogleDriveFile(location.uri, {
72
50
  fetch: this.getFetcher(location),
73
51
  });
74
52
  },
75
- /**
76
- * #action
77
- */
78
53
  async validateToken(token, location) {
79
54
  const response = await fetch(getUri(location.uri), {
80
55
  headers: {
@@ -6,7 +6,6 @@ export async function getDescriptiveErrorMessage(response, reason) {
6
6
  errorMessage = err.error.message;
7
7
  }
8
8
  catch (error) {
9
- /* do nothing */
10
9
  }
11
10
  return getResponseError({ response, reason, statusText: errorMessage });
12
11
  }
@@ -1,10 +1,12 @@
1
1
  import React, { useState } from 'react';
2
- import { Button, DialogContent, DialogActions, TextField } from '@mui/material';
3
2
  import { Dialog } from '@jbrowse/core/ui';
3
+ import { Button, DialogActions, DialogContent, TextField } from '@mui/material';
4
4
  export function HTTPBasicLoginForm({ internetAccountId, handleClose, }) {
5
5
  const [username, setUsername] = useState('');
6
6
  const [password, setPassword] = useState('');
7
- return (React.createElement(Dialog, { open: true, maxWidth: "xl", "data-testid": "login-httpbasic", title: `Log in for ${internetAccountId}` },
7
+ return (React.createElement(Dialog, { open: true, maxWidth: "xl", "data-testid": "login-httpbasic", title: `Log in for ${internetAccountId}`, onClose: () => {
8
+ handleClose();
9
+ } },
8
10
  React.createElement("form", { onSubmit: event => {
9
11
  if (username && password) {
10
12
  handleClose(btoa(`${username}:${password}`));
@@ -1,16 +1,10 @@
1
- import { Instance } from 'mobx-state-tree';
1
+ import type { Instance } from 'mobx-state-tree';
2
2
  declare const HTTPBasicConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
3
- /**
4
- * #slot
5
- */
6
3
  tokenType: {
7
4
  description: string;
8
5
  type: string;
9
6
  defaultValue: string;
10
7
  };
11
- /**
12
- * #slot
13
- */
14
8
  validateWithHEAD: {
15
9
  description: string;
16
10
  type: string;
@@ -1,30 +1,18 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
2
  import { BaseInternetAccountConfig } from '@jbrowse/core/pluggableElementTypes/models';
3
- /**
4
- * #config HTTPBasicInternetAccount
5
- */
6
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ function x() { }
7
4
  const HTTPBasicConfigSchema = ConfigurationSchema('HTTPBasicInternetAccount', {
8
- /**
9
- * #slot
10
- */
11
5
  tokenType: {
12
6
  description: 'a custom name for a token to include in the header',
13
7
  type: 'string',
14
8
  defaultValue: 'Basic',
15
9
  },
16
- /**
17
- * #slot
18
- */
19
10
  validateWithHEAD: {
20
11
  description: 'validate the token with a HEAD request before using it',
21
12
  type: 'boolean',
22
13
  defaultValue: true,
23
14
  },
24
15
  }, {
25
- /**
26
- * #baseConfiguration
27
- */
28
16
  baseConfiguration: BaseInternetAccountConfig,
29
17
  explicitlyTyped: true,
30
18
  });
@@ -1,9 +1,6 @@
1
- import { UriLocation } from '@jbrowse/core/util/types';
2
- import { Instance } from 'mobx-state-tree';
3
- import { HTTPBasicInternetAccountConfigModel } from './configSchema';
4
- /**
5
- * #stateModel HTTPBasicInternetAccount
6
- */
1
+ import type { HTTPBasicInternetAccountConfigModel } from './configSchema';
2
+ import type { UriLocation } from '@jbrowse/core/util/types';
3
+ import type { Instance } from 'mobx-state-tree';
7
4
  declare const stateModelFactory: (configSchema: HTTPBasicInternetAccountConfigModel) => import("mobx-state-tree").IModelType<{
8
5
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
9
6
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -35,13 +32,7 @@ declare const stateModelFactory: (configSchema: HTTPBasicInternetAccountConfigMo
35
32
  };
36
33
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>;
37
34
  } & {
38
- /**
39
- * #property
40
- */
41
35
  type: import("mobx-state-tree").ISimpleType<"HTTPBasicInternetAccount">;
42
- /**
43
- * #property
44
- */
45
36
  configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
46
37
  tokenType: {
47
38
  description: string;
@@ -130,18 +121,9 @@ declare const stateModelFactory: (configSchema: HTTPBasicInternetAccountConfigMo
130
121
  } & {
131
122
  openLocation(location: UriLocation): import("@jbrowse/core/util/io").RemoteFileWithRangeCache;
132
123
  } & {
133
- /**
134
- * #getter
135
- */
136
124
  readonly validateWithHEAD: boolean;
137
125
  } & {
138
- /**
139
- * #action
140
- */
141
126
  getTokenFromUser(resolve: (token: string) => void, reject: (error: Error) => void): void;
142
- /**
143
- * #action
144
- */
145
127
  validateToken(token: string, location: UriLocation): Promise<string>;
146
128
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
147
129
  export default stateModelFactory;
@@ -1,35 +1,20 @@
1
1
  import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
2
2
  import { InternetAccount } from '@jbrowse/core/pluggableElementTypes/models';
3
- import { types, getRoot } from 'mobx-state-tree';
3
+ import { getRoot, types } from 'mobx-state-tree';
4
4
  import { HTTPBasicLoginForm } from './HTTPBasicLoginForm';
5
5
  import { getResponseError } from '../util';
6
- /**
7
- * #stateModel HTTPBasicInternetAccount
8
- */
9
6
  const stateModelFactory = (configSchema) => {
10
7
  return InternetAccount.named('HTTPBasicInternetAccount')
11
8
  .props({
12
- /**
13
- * #property
14
- */
15
9
  type: types.literal('HTTPBasicInternetAccount'),
16
- /**
17
- * #property
18
- */
19
10
  configuration: ConfigurationReference(configSchema),
20
11
  })
21
12
  .views(self => ({
22
- /**
23
- * #getter
24
- */
25
13
  get validateWithHEAD() {
26
14
  return getConf(self, 'validateWithHEAD');
27
15
  },
28
16
  }))
29
17
  .actions(self => ({
30
- /**
31
- * #action
32
- */
33
18
  getTokenFromUser(resolve, reject) {
34
19
  const { session } = getRoot(self);
35
20
  session.queueDialog((doneCallback) => [
@@ -48,9 +33,6 @@ const stateModelFactory = (configSchema) => {
48
33
  },
49
34
  ]);
50
35
  },
51
- /**
52
- * #action
53
- */
54
36
  async validateToken(token, location) {
55
37
  if (!self.validateWithHEAD) {
56
38
  return token;
@@ -1,64 +1,40 @@
1
- import { Instance } from 'mobx-state-tree';
1
+ import type { Instance } from 'mobx-state-tree';
2
2
  declare const OAuthConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
3
- /**
4
- * #slot
5
- */
6
3
  tokenType: {
7
4
  description: string;
8
5
  type: string;
9
6
  defaultValue: string;
10
7
  };
11
- /**
12
- * #slot
13
- */
14
8
  authEndpoint: {
15
9
  description: string;
16
10
  type: string;
17
11
  defaultValue: string;
18
12
  };
19
- /**
20
- * #slot
21
- */
22
13
  tokenEndpoint: {
23
14
  description: string;
24
15
  type: string;
25
16
  defaultValue: string;
26
17
  };
27
- /**
28
- * #slot
29
- */
30
18
  needsPKCE: {
31
19
  description: string;
32
20
  type: string;
33
21
  defaultValue: boolean;
34
22
  };
35
- /**
36
- * #slot
37
- */
38
23
  clientId: {
39
24
  description: string;
40
25
  type: string;
41
26
  defaultValue: string;
42
27
  };
43
- /**
44
- * #slot
45
- */
46
28
  scopes: {
47
29
  description: string;
48
30
  type: string;
49
31
  defaultValue: string;
50
32
  };
51
- /**
52
- * #slot
53
- */
54
33
  state: {
55
34
  description: string;
56
35
  type: string;
57
36
  defaultValue: string;
58
37
  };
59
- /**
60
- * #slot
61
- */
62
38
  responseType: {
63
39
  description: string;
64
40
  type: string;