@jbrowse/plugin-authentication 2.17.0 → 3.0.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 (70) hide show
  1. package/dist/DropboxOAuthModel/DropboxIcon.d.ts +2 -3
  2. package/dist/DropboxOAuthModel/DropboxIcon.js +2 -6
  3. package/dist/DropboxOAuthModel/configSchema.d.ts +1 -13
  4. package/dist/DropboxOAuthModel/configSchema.js +1 -19
  5. package/dist/DropboxOAuthModel/model.d.ts +5 -28
  6. package/dist/DropboxOAuthModel/model.js +4 -26
  7. package/dist/DropboxOAuthModel/util.js +0 -5
  8. package/dist/ExternalTokenModel/ExternalTokenEntryForm.d.ts +1 -2
  9. package/dist/ExternalTokenModel/ExternalTokenEntryForm.js +16 -41
  10. package/dist/ExternalTokenModel/configSchema.d.ts +1 -4
  11. package/dist/ExternalTokenModel/configSchema.js +1 -10
  12. package/dist/ExternalTokenModel/model.d.ts +3 -3
  13. package/dist/GoogleDriveOAuthModel/GoogleDriveFilehandle.d.ts +3 -3
  14. package/dist/GoogleDriveOAuthModel/GoogleDriveFilehandle.js +1 -1
  15. package/dist/GoogleDriveOAuthModel/GoogleDriveIcon.d.ts +2 -3
  16. package/dist/GoogleDriveOAuthModel/GoogleDriveIcon.js +2 -6
  17. package/dist/GoogleDriveOAuthModel/configSchema.d.ts +1 -13
  18. package/dist/GoogleDriveOAuthModel/configSchema.js +1 -19
  19. package/dist/GoogleDriveOAuthModel/model.d.ts +5 -31
  20. package/dist/GoogleDriveOAuthModel/model.js +4 -29
  21. package/dist/GoogleDriveOAuthModel/util.js +0 -1
  22. package/dist/HTTPBasicModel/HTTPBasicLoginForm.d.ts +1 -2
  23. package/dist/HTTPBasicModel/HTTPBasicLoginForm.js +17 -44
  24. package/dist/HTTPBasicModel/configSchema.d.ts +1 -7
  25. package/dist/HTTPBasicModel/configSchema.js +1 -13
  26. package/dist/HTTPBasicModel/model.d.ts +3 -21
  27. package/dist/HTTPBasicModel/model.js +0 -18
  28. package/dist/OAuthModel/configSchema.d.ts +1 -25
  29. package/dist/OAuthModel/configSchema.js +1 -31
  30. package/dist/OAuthModel/model.d.ts +4 -90
  31. package/dist/OAuthModel/model.js +11 -101
  32. package/dist/OAuthModel/util.js +17 -9
  33. package/dist/index.d.ts +4 -4
  34. package/dist/index.js +3 -3
  35. package/esm/DropboxOAuthModel/DropboxIcon.d.ts +2 -3
  36. package/esm/DropboxOAuthModel/DropboxIcon.js +2 -3
  37. package/esm/DropboxOAuthModel/configSchema.d.ts +1 -13
  38. package/esm/DropboxOAuthModel/configSchema.js +1 -19
  39. package/esm/DropboxOAuthModel/model.d.ts +5 -28
  40. package/esm/DropboxOAuthModel/model.js +4 -26
  41. package/esm/DropboxOAuthModel/util.js +0 -5
  42. package/esm/ExternalTokenModel/ExternalTokenEntryForm.d.ts +1 -2
  43. package/esm/ExternalTokenModel/ExternalTokenEntryForm.js +16 -18
  44. package/esm/ExternalTokenModel/configSchema.d.ts +1 -4
  45. package/esm/ExternalTokenModel/configSchema.js +1 -10
  46. package/esm/ExternalTokenModel/model.d.ts +3 -3
  47. package/esm/ExternalTokenModel/model.js +1 -1
  48. package/esm/GoogleDriveOAuthModel/GoogleDriveFilehandle.d.ts +3 -3
  49. package/esm/GoogleDriveOAuthModel/GoogleDriveFilehandle.js +1 -1
  50. package/esm/GoogleDriveOAuthModel/GoogleDriveIcon.d.ts +2 -3
  51. package/esm/GoogleDriveOAuthModel/GoogleDriveIcon.js +2 -3
  52. package/esm/GoogleDriveOAuthModel/configSchema.d.ts +1 -13
  53. package/esm/GoogleDriveOAuthModel/configSchema.js +1 -19
  54. package/esm/GoogleDriveOAuthModel/model.d.ts +5 -31
  55. package/esm/GoogleDriveOAuthModel/model.js +4 -29
  56. package/esm/GoogleDriveOAuthModel/util.js +0 -1
  57. package/esm/HTTPBasicModel/HTTPBasicLoginForm.d.ts +1 -2
  58. package/esm/HTTPBasicModel/HTTPBasicLoginForm.js +17 -21
  59. package/esm/HTTPBasicModel/configSchema.d.ts +1 -7
  60. package/esm/HTTPBasicModel/configSchema.js +1 -13
  61. package/esm/HTTPBasicModel/model.d.ts +3 -21
  62. package/esm/HTTPBasicModel/model.js +1 -19
  63. package/esm/OAuthModel/configSchema.d.ts +1 -25
  64. package/esm/OAuthModel/configSchema.js +1 -31
  65. package/esm/OAuthModel/model.d.ts +4 -90
  66. package/esm/OAuthModel/model.js +11 -101
  67. package/esm/OAuthModel/util.js +0 -2
  68. package/esm/index.d.ts +4 -4
  69. package/esm/index.js +3 -3
  70. package/package.json +3 -3
@@ -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,15 +1,15 @@
1
1
  import { RemoteFileWithRangeCache } from '@jbrowse/core/util/io';
2
- import { FilehandleOptions, Stats, PolyfilledResponse } from 'generic-filehandle';
2
+ import type { FilehandleOptions, Stats } from 'generic-filehandle2';
3
3
  export interface RequestInitWithMetadata extends RequestInit {
4
4
  metadataOnly?: boolean;
5
5
  }
6
6
  interface GoogleDriveFilehandleOptions extends FilehandleOptions {
7
- fetch(input: RequestInfo, opts?: RequestInitWithMetadata): Promise<PolyfilledResponse>;
7
+ fetch(input: RequestInfo, opts?: RequestInitWithMetadata): Promise<Response>;
8
8
  }
9
9
  export declare class GoogleDriveFile extends RemoteFileWithRangeCache {
10
10
  private statsPromise;
11
11
  constructor(source: string, opts: GoogleDriveFilehandleOptions);
12
- fetch(input: RequestInfo, opts?: RequestInitWithMetadata): Promise<PolyfilledResponse>;
12
+ fetch(input: RequestInfo, opts?: RequestInitWithMetadata): Promise<Response>;
13
13
  stat(): Promise<Stats>;
14
14
  }
15
15
  export {};
@@ -4,7 +4,7 @@ export class GoogleDriveFile extends RemoteFileWithRangeCache {
4
4
  super(source, opts);
5
5
  this.statsPromise = this.fetch(source, {
6
6
  metadataOnly: true,
7
- }).then((response) => response.json());
7
+ }).then(response => response.json());
8
8
  }
9
9
  async fetch(input, opts) {
10
10
  return super.fetch(input, opts);
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
- import { SvgIconProps } from '@mui/material';
3
- export default function GoogleDriveIcon(props: SvgIconProps): React.JSX.Element;
1
+ import type { SvgIconProps } from '@mui/material';
2
+ export default function GoogleDriveIcon(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { SvgIcon } from '@mui/material';
3
3
  export default function GoogleDriveIcon(props) {
4
- return (React.createElement(SvgIcon, { ...props },
5
- React.createElement("path", { d: "M7.71,3.5L1.15,15L4.58,21L11.13,9.5M9.73,15L6.3,21H19.42L22.85,15M22.28,14L15.42,2H8.58L8.57,2L15.43,14H22.28Z" })));
4
+ return (_jsx(SvgIcon, { ...props, children: _jsx("path", { d: "M7.71,3.5L1.15,15L4.58,21L11.13,9.5M9.73,15L6.3,21H19.42L22.85,15M22.28,14L15.42,2H8.58L8.57,2L15.43,14H22.28Z" }) }));
6
5
  }
@@ -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,10 @@
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
1
  import { GoogleDriveFile } from './GoogleDriveFilehandle';
2
+ import type { GoogleDriveOAuthInternetAccountConfigModel } from './configSchema';
3
+ import type { UriLocation } from '@jbrowse/core/util/types';
4
+ import type { Instance } from 'mobx-state-tree';
6
5
  export interface RequestInitWithMetadata extends RequestInit {
7
6
  metadataOnly?: boolean;
8
7
  }
9
- /**
10
- * #stateModel GoogleDriveOAuthInternetAccount
11
- */
12
8
  export default function stateModelFactory(configSchema: GoogleDriveOAuthInternetAccountConfigModel): import("mobx-state-tree").IModelType<{
13
9
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
14
10
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -110,13 +106,7 @@ export default function stateModelFactory(configSchema: GoogleDriveOAuthInternet
110
106
  };
111
107
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>;
112
108
  } & {
113
- /**
114
- * #property
115
- */
116
109
  type: import("mobx-state-tree").ISimpleType<"GoogleDriveOAuthInternetAccount">;
117
- /**
118
- * #property
119
- */
120
110
  configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
121
111
  authEndpoint: {
122
112
  description: string;
@@ -264,7 +254,7 @@ export default function stateModelFactory(configSchema: GoogleDriveOAuthInternet
264
254
  readonly clientId: string;
265
255
  readonly scopes: string;
266
256
  state(): string | undefined;
267
- readonly responseType: "code" | "token";
257
+ readonly responseType: "token" | "code";
268
258
  readonly refreshTokenKey: string;
269
259
  } & {
270
260
  storeRefreshToken(refreshToken: string): void;
@@ -282,27 +272,11 @@ export default function stateModelFactory(configSchema: GoogleDriveOAuthInternet
282
272
  } & {
283
273
  getFetcher(loc?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
284
274
  } & {
285
- /**
286
- * #getter
287
- * The FileSelector icon for Google drive
288
- */
289
- readonly toggleContents: React.JSX.Element;
290
- /**
291
- * #getter
292
- */
275
+ readonly toggleContents: import("react/jsx-runtime").JSX.Element;
293
276
  readonly selectorLabel: string;
294
277
  } & {
295
- /**
296
- * #method
297
- */
298
278
  getFetcher(location?: UriLocation): (input: RequestInfo, init?: RequestInitWithMetadata) => Promise<Response>;
299
- /**
300
- * #method
301
- */
302
279
  openLocation(location: UriLocation): GoogleDriveFile;
303
- /**
304
- * #action
305
- */
306
280
  validateToken(token: string, location: UriLocation): Promise<string>;
307
281
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
308
282
  export type GoogleDriveOAuthStateModel = ReturnType<typeof stateModelFactory>;
@@ -1,50 +1,31 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
- return React.createElement(GoogleDriveIcon, null);
22
+ return _jsx(GoogleDriveIcon, {});
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,5 +1,4 @@
1
- import React from 'react';
2
1
  export declare function HTTPBasicLoginForm({ internetAccountId, handleClose, }: {
3
2
  internetAccountId: string;
4
3
  handleClose: (arg?: string) => void;
5
- }): React.JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,13 @@
1
- import React, { useState } from 'react';
2
- import { Button, DialogContent, DialogActions, TextField } from '@mui/material';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
3
  import { Dialog } from '@jbrowse/core/ui';
4
+ import { Button, DialogActions, DialogContent, TextField } from '@mui/material';
4
5
  export function HTTPBasicLoginForm({ internetAccountId, handleClose, }) {
5
6
  const [username, setUsername] = useState('');
6
7
  const [password, setPassword] = useState('');
7
- return (React.createElement(Dialog, { open: true, maxWidth: "xl", "data-testid": "login-httpbasic", title: `Log in for ${internetAccountId}` },
8
- React.createElement("form", { onSubmit: event => {
8
+ return (_jsx(Dialog, { open: true, maxWidth: "xl", "data-testid": "login-httpbasic", title: `Log in for ${internetAccountId}`, onClose: () => {
9
+ handleClose();
10
+ }, children: _jsxs("form", { onSubmit: event => {
9
11
  if (username && password) {
10
12
  handleClose(btoa(`${username}:${password}`));
11
13
  }
@@ -13,21 +15,15 @@ export function HTTPBasicLoginForm({ internetAccountId, handleClose, }) {
13
15
  handleClose();
14
16
  }
15
17
  event.preventDefault();
16
- } },
17
- React.createElement(DialogContent, { style: { display: 'flex', flexDirection: 'column' } },
18
- React.createElement(TextField, { required: true, label: "Username", variant: "outlined", onChange: event => {
19
- setUsername(event.target.value);
20
- }, margin: "dense", slotProps: {
21
- htmlInput: { 'data-testid': 'login-httpbasic-username' },
22
- } }),
23
- React.createElement(TextField, { required: true, label: "Password", type: "password", autoComplete: "current-password", variant: "outlined", onChange: event => {
24
- setPassword(event.target.value);
25
- }, margin: "dense", slotProps: {
26
- htmlInput: { 'data-testid': 'login-httpbasic-password' },
27
- } })),
28
- React.createElement(DialogActions, null,
29
- React.createElement(Button, { variant: "contained", color: "primary", type: "submit" }, "Submit"),
30
- React.createElement(Button, { variant: "contained", color: "secondary", type: "submit", onClick: () => {
31
- handleClose();
32
- } }, "Cancel")))));
18
+ }, children: [_jsxs(DialogContent, { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx(TextField, { required: true, label: "Username", variant: "outlined", onChange: event => {
19
+ setUsername(event.target.value);
20
+ }, margin: "dense", slotProps: {
21
+ htmlInput: { 'data-testid': 'login-httpbasic-username' },
22
+ } }), _jsx(TextField, { required: true, label: "Password", type: "password", autoComplete: "current-password", variant: "outlined", onChange: event => {
23
+ setPassword(event.target.value);
24
+ }, margin: "dense", slotProps: {
25
+ htmlInput: { 'data-testid': 'login-httpbasic-password' },
26
+ } })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "primary", type: "submit", children: "Submit" }), _jsx(Button, { variant: "contained", color: "secondary", type: "submit", onClick: () => {
27
+ handleClose();
28
+ }, children: "Cancel" })] })] }) }));
33
29
  }
@@ -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;
@@ -1,78 +1,48 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
2
  import { BaseInternetAccountConfig } from '@jbrowse/core/pluggableElementTypes/models';
3
- /**
4
- * #config OAuthInternetAccount
5
- */
6
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ function x() { }
7
4
  const OAuthConfigSchema = ConfigurationSchema('OAuthInternetAccount', {
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: 'Bearer',
15
9
  },
16
- /**
17
- * #slot
18
- */
19
10
  authEndpoint: {
20
11
  description: 'the authorization code endpoint of the internet account',
21
12
  type: 'string',
22
13
  defaultValue: '',
23
14
  },
24
- /**
25
- * #slot
26
- */
27
15
  tokenEndpoint: {
28
16
  description: 'the token endpoint of the internet account',
29
17
  type: 'string',
30
18
  defaultValue: '',
31
19
  },
32
- /**
33
- * #slot
34
- */
35
20
  needsPKCE: {
36
21
  description: 'boolean to indicate if the endpoint needs a PKCE code',
37
22
  type: 'boolean',
38
23
  defaultValue: false,
39
24
  },
40
- /**
41
- * #slot
42
- */
43
25
  clientId: {
44
26
  description: 'id for the OAuth application',
45
27
  type: 'string',
46
28
  defaultValue: '',
47
29
  },
48
- /**
49
- * #slot
50
- */
51
30
  scopes: {
52
31
  description: 'optional scopes for the authorization call',
53
32
  type: 'string',
54
33
  defaultValue: '',
55
34
  },
56
- /**
57
- * #slot
58
- */
59
35
  state: {
60
36
  description: 'optional state for the authorization call',
61
37
  type: 'string',
62
38
  defaultValue: '',
63
39
  },
64
- /**
65
- * #slot
66
- */
67
40
  responseType: {
68
41
  description: "the type of response from the authorization endpoint. can be 'token' or 'code'",
69
42
  type: 'string',
70
43
  defaultValue: 'code',
71
44
  },
72
45
  }, {
73
- /**
74
- * #baseConfiguration
75
- */
76
46
  baseConfiguration: BaseInternetAccountConfig,
77
47
  explicitlyTyped: true,
78
48
  });