@xh/hoist 73.0.0-SNAPSHOT.1743808100261 → 73.0.0-SNAPSHOT.1744065661676

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.
@@ -10,6 +10,6 @@ import '@xh/hoist/desktop/register';
10
10
  *
11
11
  * Overflowing tabs can be displayed in a dropdown menu if `enableOverflow` is true.
12
12
  * Note that in order for tabs to overflow, the TabSwitcher or it's wrapper must have a
13
- * a maximum width.
13
+ * maximum width.
14
14
  */
15
15
  export declare const TabSwitcher: import("react").FC<TabSwitcherProps>, tabSwitcher: import("@xh/hoist/core").ElementFactory<TabSwitcherProps>;
@@ -40,14 +40,13 @@ export interface BaseOAuthClientConfig<S extends AccessTokenSpec> {
40
40
  */
41
41
  idScopes?: string[];
42
42
  /**
43
- * Optional map of access tokens to be loaded and maintained.
43
+ * Optional spec for access tokens to be loaded and maintained to support access to one or more
44
+ * different back-end resources, distinct from the core Hoist auth flow via ID token.
44
45
  *
45
- * Map of code to a spec for an access token. The code is app-determined and
46
- * will simply be used to get the loaded token via tha getAccessToken() method. The
47
- * spec is implementation specific, but will typically include scopes to be loaded
48
- * for the access token and potentially other meta-data required by the underlying provider.
49
- *
50
- * Use this map to gain targeted access tokens for different back-end resources.
46
+ * Map of key to a spec for an access token. The key is an arbitrary, app-determined string
47
+ * used to retrieve the loaded token via {@link getAccessTokenAsync}. The spec is implementation
48
+ * specific, but will typically include scopes to be loaded for the access token and potentially
49
+ * other metadata required by the underlying provider.
51
50
  */
52
51
  accessTokens?: Record<string, S>;
53
52
  }
@@ -2,11 +2,13 @@ import { Token } from './Token';
2
2
  export type TokenMap = Record<string, Token>;
3
3
  export interface AccessTokenSpec {
4
4
  /**
5
- * Mode governing when the access token should be requested from provider.
6
- * eager (default) - initiate lookup on initialization, but do not block on failure.
7
- * lazy - lookup when requested by client.
5
+ * Mode governing when the access token should be requested from provider:
6
+ * - eager (or undefined) - load on overall initialization, but do not block on failure.
7
+ * Useful for tokens that an app is almost certain to require during a user session.
8
+ * - lazy - defer loading until first requested by client. Useful for tokens that might
9
+ * never be needed by the app during a given user session.
8
10
  */
9
- fetchMode: 'eager' | 'lazy';
11
+ fetchMode?: 'eager' | 'lazy';
10
12
  /** Scopes for the desired access token.*/
11
13
  scopes: string[];
12
14
  }
@@ -41,7 +41,7 @@ import {CSSProperties, ReactElement, KeyboardEvent} from 'react';
41
41
  *
42
42
  * Overflowing tabs can be displayed in a dropdown menu if `enableOverflow` is true.
43
43
  * Note that in order for tabs to overflow, the TabSwitcher or it's wrapper must have a
44
- * a maximum width.
44
+ * maximum width.
45
45
  */
46
46
  export const [TabSwitcher, tabSwitcher] = hoistCmp.withFactory<TabSwitcherProps>({
47
47
  displayName: 'TabSwitcher',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "73.0.0-SNAPSHOT.1743808100261",
3
+ "version": "73.0.0-SNAPSHOT.1744065661676",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -64,14 +64,13 @@ export interface BaseOAuthClientConfig<S extends AccessTokenSpec> {
64
64
  idScopes?: string[];
65
65
 
66
66
  /**
67
- * Optional map of access tokens to be loaded and maintained.
67
+ * Optional spec for access tokens to be loaded and maintained to support access to one or more
68
+ * different back-end resources, distinct from the core Hoist auth flow via ID token.
68
69
  *
69
- * Map of code to a spec for an access token. The code is app-determined and
70
- * will simply be used to get the loaded token via tha getAccessToken() method. The
71
- * spec is implementation specific, but will typically include scopes to be loaded
72
- * for the access token and potentially other meta-data required by the underlying provider.
73
- *
74
- * Use this map to gain targeted access tokens for different back-end resources.
70
+ * Map of key to a spec for an access token. The key is an arbitrary, app-determined string
71
+ * used to retrieve the loaded token via {@link getAccessTokenAsync}. The spec is implementation
72
+ * specific, but will typically include scopes to be loaded for the access token and potentially
73
+ * other metadata required by the underlying provider.
75
74
  */
76
75
  accessTokens?: Record<string, S>;
77
76
  }
@@ -314,7 +313,7 @@ export abstract class BaseOAuthClient<
314
313
  const eagerOnly = opts?.eagerOnly ?? false,
315
314
  useCache = opts?.useCache ?? true,
316
315
  accessSpecs = eagerOnly
317
- ? pickBy(this.accessSpecs, spec => spec.fetchMode === 'eager')
316
+ ? pickBy(this.accessSpecs, spec => spec.fetchMode !== 'lazy') // specs are eager by default - opt-in to lazy
318
317
  : this.accessSpecs,
319
318
  ret: TokenMap = {};
320
319
 
package/security/Types.ts CHANGED
@@ -11,11 +11,13 @@ export type TokenMap = Record<string, Token>;
11
11
 
12
12
  export interface AccessTokenSpec {
13
13
  /**
14
- * Mode governing when the access token should be requested from provider.
15
- * eager (default) - initiate lookup on initialization, but do not block on failure.
16
- * lazy - lookup when requested by client.
14
+ * Mode governing when the access token should be requested from provider:
15
+ * - eager (or undefined) - load on overall initialization, but do not block on failure.
16
+ * Useful for tokens that an app is almost certain to require during a user session.
17
+ * - lazy - defer loading until first requested by client. Useful for tokens that might
18
+ * never be needed by the app during a given user session.
17
19
  */
18
- fetchMode: 'eager' | 'lazy';
20
+ fetchMode?: 'eager' | 'lazy';
19
21
 
20
22
  /** Scopes for the desired access token.*/
21
23
  scopes: string[];