@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
@@ -9,7 +9,6 @@ async function getDescriptiveErrorMessage(response, reason) {
9
9
  errorMessage = err.error.message;
10
10
  }
11
11
  catch (error) {
12
- /* do nothing */
13
12
  }
14
13
  return (0, util_1.getResponseError)({ response, reason, statusText: errorMessage });
15
14
  }
@@ -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,37 +1,16 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.HTTPBasicLoginForm = HTTPBasicLoginForm;
27
- const react_1 = __importStar(require("react"));
28
- const material_1 = require("@mui/material");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
29
6
  const ui_1 = require("@jbrowse/core/ui");
7
+ const material_1 = require("@mui/material");
30
8
  function HTTPBasicLoginForm({ internetAccountId, handleClose, }) {
31
9
  const [username, setUsername] = (0, react_1.useState)('');
32
10
  const [password, setPassword] = (0, react_1.useState)('');
33
- return (react_1.default.createElement(ui_1.Dialog, { open: true, maxWidth: "xl", "data-testid": "login-httpbasic", title: `Log in for ${internetAccountId}` },
34
- react_1.default.createElement("form", { onSubmit: event => {
11
+ return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, maxWidth: "xl", "data-testid": "login-httpbasic", title: `Log in for ${internetAccountId}`, onClose: () => {
12
+ handleClose();
13
+ }, children: (0, jsx_runtime_1.jsxs)("form", { onSubmit: event => {
35
14
  if (username && password) {
36
15
  handleClose(btoa(`${username}:${password}`));
37
16
  }
@@ -39,21 +18,15 @@ function HTTPBasicLoginForm({ internetAccountId, handleClose, }) {
39
18
  handleClose();
40
19
  }
41
20
  event.preventDefault();
42
- } },
43
- react_1.default.createElement(material_1.DialogContent, { style: { display: 'flex', flexDirection: 'column' } },
44
- react_1.default.createElement(material_1.TextField, { required: true, label: "Username", variant: "outlined", onChange: event => {
45
- setUsername(event.target.value);
46
- }, margin: "dense", slotProps: {
47
- htmlInput: { 'data-testid': 'login-httpbasic-username' },
48
- } }),
49
- react_1.default.createElement(material_1.TextField, { required: true, label: "Password", type: "password", autoComplete: "current-password", variant: "outlined", onChange: event => {
50
- setPassword(event.target.value);
51
- }, margin: "dense", slotProps: {
52
- htmlInput: { 'data-testid': 'login-httpbasic-password' },
53
- } })),
54
- react_1.default.createElement(material_1.DialogActions, null,
55
- react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", type: "submit" }, "Submit"),
56
- react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", type: "submit", onClick: () => {
57
- handleClose();
58
- } }, "Cancel")))));
21
+ }, children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, label: "Username", variant: "outlined", onChange: event => {
22
+ setUsername(event.target.value);
23
+ }, margin: "dense", slotProps: {
24
+ htmlInput: { 'data-testid': 'login-httpbasic-username' },
25
+ } }), (0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, label: "Password", type: "password", autoComplete: "current-password", variant: "outlined", onChange: event => {
26
+ setPassword(event.target.value);
27
+ }, margin: "dense", slotProps: {
28
+ htmlInput: { 'data-testid': 'login-httpbasic-password' },
29
+ } })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", children: "Submit" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", type: "submit", onClick: () => {
30
+ handleClose();
31
+ }, children: "Cancel" })] })] }) }));
59
32
  }
@@ -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;
@@ -2,31 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const configuration_1 = require("@jbrowse/core/configuration");
4
4
  const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
5
- /**
6
- * #config HTTPBasicInternetAccount
7
- */
8
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ function x() { }
9
6
  const HTTPBasicConfigSchema = (0, configuration_1.ConfigurationSchema)('HTTPBasicInternetAccount', {
10
- /**
11
- * #slot
12
- */
13
7
  tokenType: {
14
8
  description: 'a custom name for a token to include in the header',
15
9
  type: 'string',
16
10
  defaultValue: 'Basic',
17
11
  },
18
- /**
19
- * #slot
20
- */
21
12
  validateWithHEAD: {
22
13
  description: 'validate the token with a HEAD request before using it',
23
14
  type: 'boolean',
24
15
  defaultValue: true,
25
16
  },
26
17
  }, {
27
- /**
28
- * #baseConfiguration
29
- */
30
18
  baseConfiguration: models_1.BaseInternetAccountConfig,
31
19
  explicitlyTyped: true,
32
20
  });
@@ -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;
@@ -5,33 +5,18 @@ const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
5
5
  const mobx_state_tree_1 = require("mobx-state-tree");
6
6
  const HTTPBasicLoginForm_1 = require("./HTTPBasicLoginForm");
7
7
  const util_1 = require("../util");
8
- /**
9
- * #stateModel HTTPBasicInternetAccount
10
- */
11
8
  const stateModelFactory = (configSchema) => {
12
9
  return models_1.InternetAccount.named('HTTPBasicInternetAccount')
13
10
  .props({
14
- /**
15
- * #property
16
- */
17
11
  type: mobx_state_tree_1.types.literal('HTTPBasicInternetAccount'),
18
- /**
19
- * #property
20
- */
21
12
  configuration: (0, configuration_1.ConfigurationReference)(configSchema),
22
13
  })
23
14
  .views(self => ({
24
- /**
25
- * #getter
26
- */
27
15
  get validateWithHEAD() {
28
16
  return (0, configuration_1.getConf)(self, 'validateWithHEAD');
29
17
  },
30
18
  }))
31
19
  .actions(self => ({
32
- /**
33
- * #action
34
- */
35
20
  getTokenFromUser(resolve, reject) {
36
21
  const { session } = (0, mobx_state_tree_1.getRoot)(self);
37
22
  session.queueDialog((doneCallback) => [
@@ -50,9 +35,6 @@ const stateModelFactory = (configSchema) => {
50
35
  },
51
36
  ]);
52
37
  },
53
- /**
54
- * #action
55
- */
56
38
  async validateToken(token, location) {
57
39
  if (!self.validateWithHEAD) {
58
40
  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;
@@ -2,79 +2,49 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const configuration_1 = require("@jbrowse/core/configuration");
4
4
  const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
5
- /**
6
- * #config OAuthInternetAccount
7
- */
8
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ function x() { }
9
6
  const OAuthConfigSchema = (0, configuration_1.ConfigurationSchema)('OAuthInternetAccount', {
10
- /**
11
- * #slot
12
- */
13
7
  tokenType: {
14
8
  description: 'a custom name for a token to include in the header',
15
9
  type: 'string',
16
10
  defaultValue: 'Bearer',
17
11
  },
18
- /**
19
- * #slot
20
- */
21
12
  authEndpoint: {
22
13
  description: 'the authorization code endpoint of the internet account',
23
14
  type: 'string',
24
15
  defaultValue: '',
25
16
  },
26
- /**
27
- * #slot
28
- */
29
17
  tokenEndpoint: {
30
18
  description: 'the token endpoint of the internet account',
31
19
  type: 'string',
32
20
  defaultValue: '',
33
21
  },
34
- /**
35
- * #slot
36
- */
37
22
  needsPKCE: {
38
23
  description: 'boolean to indicate if the endpoint needs a PKCE code',
39
24
  type: 'boolean',
40
25
  defaultValue: false,
41
26
  },
42
- /**
43
- * #slot
44
- */
45
27
  clientId: {
46
28
  description: 'id for the OAuth application',
47
29
  type: 'string',
48
30
  defaultValue: '',
49
31
  },
50
- /**
51
- * #slot
52
- */
53
32
  scopes: {
54
33
  description: 'optional scopes for the authorization call',
55
34
  type: 'string',
56
35
  defaultValue: '',
57
36
  },
58
- /**
59
- * #slot
60
- */
61
37
  state: {
62
38
  description: 'optional state for the authorization call',
63
39
  type: 'string',
64
40
  defaultValue: '',
65
41
  },
66
- /**
67
- * #slot
68
- */
69
42
  responseType: {
70
43
  description: "the type of response from the authorization endpoint. can be 'token' or 'code'",
71
44
  type: 'string',
72
45
  defaultValue: 'code',
73
46
  },
74
47
  }, {
75
- /**
76
- * #baseConfiguration
77
- */
78
48
  baseConfiguration: models_1.BaseInternetAccountConfig,
79
49
  explicitlyTyped: true,
80
50
  });
@@ -1,9 +1,6 @@
1
- import { UriLocation } from '@jbrowse/core/util';
2
- import { Instance } from 'mobx-state-tree';
3
- import { OAuthInternetAccountConfigModel } from './configSchema';
4
- /**
5
- * #stateModel OAuthInternetAccount
6
- */
1
+ import type { OAuthInternetAccountConfigModel } from './configSchema';
2
+ import type { UriLocation } from '@jbrowse/core/util';
3
+ import type { Instance } from 'mobx-state-tree';
7
4
  declare const stateModelFactory: (configSchema: OAuthInternetAccountConfigModel) => 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: OAuthInternetAccountConfigModel)
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<"OAuthInternetAccount">;
42
- /**
43
- * #property
44
- */
45
36
  configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
46
37
  tokenType: {
47
38
  description: string;
@@ -160,107 +151,30 @@ declare const stateModelFactory: (configSchema: OAuthInternetAccountConfigModel)
160
151
  } & {
161
152
  openLocation(location: UriLocation): import("@jbrowse/core/util/io").RemoteFileWithRangeCache;
162
153
  } & {
163
- /**
164
- * #getter
165
- */
166
154
  readonly codeVerifierPKCE: string;
167
155
  } & {
168
- /**
169
- * #getter
170
- */
171
156
  readonly authEndpoint: string;
172
- /**
173
- * #getter
174
- */
175
157
  readonly tokenEndpoint: string;
176
- /**
177
- * #getter
178
- */
179
158
  readonly needsPKCE: boolean;
180
- /**
181
- * #getter
182
- */
183
159
  readonly clientId: string;
184
- /**
185
- * #getter
186
- */
187
160
  readonly scopes: string;
188
- /**
189
- * #method
190
- * OAuth state parameter:
191
- * https://www.rfc-editor.org/rfc/rfc6749#section-4.1.1
192
- *
193
- * Can override or extend if dynamic state is needed.
194
- */
195
161
  state(): string | undefined;
196
- /**
197
- * #getter
198
- */
199
- readonly responseType: "code" | "token";
200
- /**
201
- * #getter
202
- */
162
+ readonly responseType: "token" | "code";
203
163
  readonly refreshTokenKey: string;
204
164
  } & {
205
- /**
206
- * #action
207
- */
208
165
  storeRefreshToken(refreshToken: string): void;
209
- /**
210
- * #action
211
- */
212
166
  removeRefreshToken(): void;
213
- /**
214
- * #method
215
- */
216
167
  retrieveRefreshToken(): string | null;
217
- /**
218
- * #action
219
- */
220
168
  exchangeAuthorizationForAccessToken(token: string, redirectUri: string): Promise<string>;
221
- /**
222
- * #action
223
- */
224
169
  exchangeRefreshForAccessToken(refreshToken: string): Promise<string>;
225
170
  } & {
226
- /**
227
- * #action
228
- * used to listen to child window for auth code/token
229
- */
230
171
  addMessageChannel(resolve: (token: string) => void, reject: (error: Error) => void): void;
231
- /**
232
- * #action
233
- */
234
172
  deleteMessageChannel(): void;
235
- /**
236
- * #action
237
- */
238
173
  finishOAuthWindow(event: MessageEvent, resolve: (token: string) => void, reject: (error: Error) => void): Promise<void>;
239
- /**
240
- * #action
241
- * opens external OAuth flow, popup for web and new browser window for
242
- * desktop
243
- */
244
174
  useEndpointForAuthorization(resolve: (token: string) => void, reject: (error: Error) => void): Promise<void>;
245
- /**
246
- * #action
247
- */
248
175
  getTokenFromUser(resolve: (token: string) => void, reject: (error: Error) => void): Promise<void>;
249
- /**
250
- * #action
251
- */
252
176
  validateToken(token: string, location: UriLocation): Promise<string>;
253
177
  } & {
254
- /**
255
- * #action
256
- * Get a fetch method that will add any needed authentication headers
257
- * to the request before sending it. If location is provided, it will
258
- * be checked to see if it includes a token in it's pre-auth
259
- * information.
260
- *
261
- * @param loc - UriLocation of the resource
262
- * @returns A function that can be used to fetch
263
- */
264
178
  getFetcher(loc?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
265
179
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
266
180
  export default stateModelFactory;