@jbrowse/plugin-authentication 2.11.2 → 2.12.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.
@@ -74,9 +74,7 @@ declare const OAuthConfigSchema: import("@jbrowse/core/configuration/configurati
74
74
  description: string;
75
75
  type: string;
76
76
  defaultValue: string;
77
- }; /**
78
- * #slot
79
- */
77
+ };
80
78
  authHeader: {
81
79
  description: string;
82
80
  type: string;
@@ -1,79 +1,10 @@
1
- /// <reference types="react" />
2
1
  import { UriLocation } from '@jbrowse/core/util';
3
2
  import { Instance } from 'mobx-state-tree';
3
+ import { OAuthInternetAccountConfigModel } from './configSchema';
4
4
  /**
5
5
  * #stateModel OAuthInternetAccount
6
6
  */
7
- declare const stateModelFactory: (configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
8
- tokenType: {
9
- description: string;
10
- type: string;
11
- defaultValue: string;
12
- };
13
- authEndpoint: {
14
- description: string;
15
- type: string;
16
- defaultValue: string;
17
- };
18
- tokenEndpoint: {
19
- description: string;
20
- type: string;
21
- defaultValue: string;
22
- };
23
- needsPKCE: {
24
- description: string;
25
- type: string;
26
- defaultValue: boolean;
27
- };
28
- clientId: {
29
- description: string; /**
30
- * #getter
31
- */
32
- type: string;
33
- defaultValue: string;
34
- };
35
- scopes: {
36
- description: string;
37
- type: string;
38
- defaultValue: string;
39
- };
40
- state: {
41
- description: string;
42
- type: string;
43
- defaultValue: string;
44
- };
45
- responseType: {
46
- description: string;
47
- type: string;
48
- defaultValue: string;
49
- };
50
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
51
- name: {
52
- description: string;
53
- type: string;
54
- defaultValue: string;
55
- };
56
- description: {
57
- description: string;
58
- type: string;
59
- defaultValue: string;
60
- };
61
- authHeader: {
62
- description: string;
63
- type: string;
64
- defaultValue: string;
65
- };
66
- tokenType: {
67
- description: string;
68
- type: string;
69
- defaultValue: string;
70
- };
71
- domains: {
72
- description: string;
73
- type: string;
74
- defaultValue: never[];
75
- };
76
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>) => import("mobx-state-tree").IModelType<{
7
+ declare const stateModelFactory: (configSchema: OAuthInternetAccountConfigModel) => import("mobx-state-tree").IModelType<{
77
8
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
78
9
  type: import("mobx-state-tree").ISimpleType<string>;
79
10
  configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
@@ -98,9 +29,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
98
29
  defaultValue: string;
99
30
  };
100
31
  domains: {
101
- description: string; /**
102
- * #getter
103
- */
32
+ description: string;
104
33
  type: string;
105
34
  defaultValue: never[];
106
35
  };
@@ -135,9 +64,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
135
64
  defaultValue: boolean;
136
65
  };
137
66
  clientId: {
138
- description: string; /**
139
- * #getter
140
- */
67
+ description: string;
141
68
  type: string;
142
69
  defaultValue: string;
143
70
  };
@@ -186,13 +113,9 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
186
113
  }, {
187
114
  readonly name: string;
188
115
  readonly description: string;
189
- readonly internetAccountId: string; /**
190
- * #getter
191
- */
116
+ readonly internetAccountId: string;
192
117
  readonly authHeader: string;
193
- readonly tokenType: string; /**
194
- * #getter
195
- */
118
+ readonly tokenType: string;
196
119
  readonly domains: string[];
197
120
  readonly toggleContents: import("react").ReactNode;
198
121
  readonly SelectorComponent: import("@jbrowse/core/util").AnyReactComponentType | undefined;
@@ -207,23 +130,23 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
207
130
  retrieveToken(): string | null;
208
131
  validateToken(token: string, _loc: UriLocation): Promise<string>;
209
132
  } & {
210
- getToken(location?: UriLocation | undefined): Promise<string>;
133
+ getToken(location?: UriLocation): Promise<string>;
211
134
  } & {
212
135
  addAuthHeaderToInit(init: RequestInit | undefined, token: string): {
213
136
  headers: Headers;
214
- body?: BodyInit | null | undefined;
215
- cache?: RequestCache | undefined;
216
- credentials?: RequestCredentials | undefined;
217
- integrity?: string | undefined;
218
- keepalive?: boolean | undefined;
219
- method?: string | undefined;
220
- mode?: RequestMode | undefined;
221
- priority?: RequestPriority | undefined;
222
- redirect?: RequestRedirect | undefined;
223
- referrer?: string | undefined;
224
- referrerPolicy?: ReferrerPolicy | undefined;
225
- signal?: AbortSignal | null | undefined;
226
- window?: null | undefined;
137
+ body?: BodyInit | null;
138
+ cache?: RequestCache;
139
+ credentials?: RequestCredentials;
140
+ integrity?: string;
141
+ keepalive?: boolean;
142
+ method?: string;
143
+ mode?: RequestMode;
144
+ priority?: RequestPriority;
145
+ redirect?: RequestRedirect;
146
+ referrer?: string;
147
+ referrerPolicy?: ReferrerPolicy;
148
+ signal?: AbortSignal | null;
149
+ window?: null;
227
150
  };
228
151
  getPreAuthorizationInformation(location: UriLocation): Promise<{
229
152
  internetAccountType: string;
@@ -233,7 +156,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
233
156
  };
234
157
  }>;
235
158
  } & {
236
- getFetcher(loc?: UriLocation | undefined): (input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
159
+ getFetcher(loc?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
237
160
  } & {
238
161
  openLocation(location: UriLocation): import("@jbrowse/core/util/io").RemoteFileWithRangeCache;
239
162
  } & {
@@ -23,17 +23,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.processTokenResponse = exports.processError = exports.generateChallenge = exports.fixup = void 0;
26
+ exports.fixup = fixup;
27
+ exports.generateChallenge = generateChallenge;
28
+ exports.processError = processError;
29
+ exports.processTokenResponse = processTokenResponse;
27
30
  function fixup(buf) {
28
31
  return buf.replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '');
29
32
  }
30
- exports.fixup = fixup;
31
33
  async function generateChallenge(val) {
32
34
  const sha256 = await Promise.resolve().then(() => __importStar(require('crypto-js/sha256'))).then(f => f.default);
33
35
  const Base64 = await Promise.resolve().then(() => __importStar(require('crypto-js/enc-base64')));
34
36
  return fixup(Base64.stringify(sha256(val)));
35
37
  }
36
- exports.generateChallenge = generateChallenge;
37
38
  // if response is JSON, checks if it needs to remove tokens in error, or just plain throw
38
39
  function processError(text, invalidErrorCb) {
39
40
  var _a;
@@ -49,11 +50,9 @@ function processError(text, invalidErrorCb) {
49
50
  }
50
51
  return text;
51
52
  }
52
- exports.processError = processError;
53
53
  function processTokenResponse(data, storeRefreshTokenCb) {
54
54
  if (data.refresh_token) {
55
55
  storeRefreshTokenCb(data.refresh_token);
56
56
  }
57
57
  return data.access_token;
58
58
  }
59
- exports.processTokenResponse = processTokenResponse;