@servicetitan/docs-uikit 28.3.2 → 28.4.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.
@@ -58,16 +58,17 @@ const App = () => {
58
58
 
59
59
  `withMicroservice` accepts an object with the following properties:
60
60
 
61
- | Name | Type | Description |
62
- | :---------------- | :---------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------- |
63
- | `authAdapter` | <code>string &#124; Function</code> | (optional) authentication scheme ([see below](#auth-adapter)). Defaults to **Bearer** authentication. |
64
- | `authURL` | `string` | (optional) authentication endpoint for protected resources. Value is only optional for **Token** authentication. It is required for **Bearer** authentication. |
65
- | `axiosInstance` | `AxiosInstance` | (optional) Axios instance which will be used for authenticated requests. Defaults to the global Axios
66
- | `baseURL` | `string` | base URL of protected resources |
67
- | `component` | `React.ComponentType` | component to wrap |
68
- | `extraHeaders` | `Record<string, any>` | (optional) extra headers to add to requests |
69
- | `preAuthenticate` | `boolean` | (optional) whether to authenticate immediately or wait for the first request. Defaults to `false`. |
70
- | `tokens` | `Symbol[]` | (optional) symbols to use to provide `baseURL` to autogenerated API services and child components |
61
+ | Name | Type | Description |
62
+ | :------------------------ | :---------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
63
+ | `authAdapter` | <code>string &#124; Function</code> | (optional) authentication scheme ([see below](#auth-adapter)). Defaults to **Bearer** authentication. |
64
+ | `authURL` | `string` | (optional) authentication endpoint for protected resources. Value is only optional for **Token** authentication. It is required for **Bearer** authentication. |
65
+ | `axiosInstance` | `AxiosInstance` | (optional) Axios instance which will be used for authenticated requests. Defaults to the global Axios |
66
+ | `baseURL` | `string` | base URL of protected resources |
67
+ | `component` | `React.ComponentType` | component to wrap |
68
+ | `extraHeaders` | `Record<string, any>` | (optional) extra headers to add to requests |
69
+ | `preAuthenticate` | `boolean` | (optional) whether to authenticate immediately or wait for the first request. Defaults to `false`. Value is ignored for Token Server authentication ([see below](#pre-authenticate)). |
70
+ | `preAuthenticateCallback` | `(error?: any) => void` | (optional) callback to call after pre-authentication succeeds or fails. If pre-authentication fails, the error is passed to the first parameter of the callback. |
71
+ | `tokens` | `Symbol[]` | (optional) symbols to use to provide `baseURL` to autogenerated API services and child components |
71
72
 
72
73
  #### authAdapter{#auth-adapter}
73
74
 
@@ -87,7 +88,7 @@ The authentication endpoint for protected resources.
87
88
 
88
89
  - For **Token server** authentication, this the "silent login" endpoint. Defaults to `${baseURL}/bff/silent-login`.
89
90
 
90
- #### preAuthenticate
91
+ #### preAuthenticate{#pre-authenticate}
91
92
 
92
93
  Controls when authentication happens:
93
94
 
@@ -96,6 +97,8 @@ Controls when authentication happens:
96
97
  | `false` | Wait for the first request to a protected resource. This is the default value. |
97
98
  | `true` | Authenticate immediately after the component is loaded |
98
99
 
100
+ When using Token Server authentication, authentication is always performed after the component is loaded and this value is ignored.
101
+
99
102
  #### tokens
100
103
 
101
104
  The main purpose of `tokens` is to [provide](./react-ioc#provide) the `baseURL` to autogenerated API services.
@@ -37,9 +37,9 @@ export const Foo: React.FC = () => {
37
37
  | `fallbackSrc` | optional alternative path to an MFE root folder (if request for src returns error) |
38
38
  | `data` | additional data passed to an MFE as an object, where values are serializable, and preferably memoized ([see below](#passing-data-from-host-to-mfe)) |
39
39
  | `basename` | prefix for all MFE URLs, you should inject it by the `BASENAME_TOKEN` and pass to the appropriate router property |
40
- | `loadingFallback` | optional JSX element to render when the MFE is loading |
40
+ | `loadingFallback` | optional ReactNode to render when the MFE is loading |
41
41
  | `loadingFallbackDelayed` | controls whether to render the loading fallback immediately, or after a short delay [(see below)](#fallback-delay) |
42
- | `errorFallback` | optional JSX element to render when the MFE fails to load |
42
+ | `errorFallback` | optional ReactNode to render when the MFE fails to load |
43
43
  | `className` | additional CSS classes for the MFE web component element |
44
44
  | `cache` | optional cache strategy for the MFE [(see below)](#cache-strategy) |
45
45
 
@@ -51,10 +51,10 @@ To prevent the loading fallback from flickering on then off when an MFE loads qu
51
51
 
52
52
  When an MFE is loaded, `Loader` fetches the version and bundle data from the `src` (or `fallbackSrc`) endpoint and stores the information in a cache. Then, if the MFE is unloaded and subsequently reloaded, it reuses the cached information. Use `cache` to control whether or how long `Loader` caches an MFE's data:
53
53
 
54
- - `true`: cache the data for the standard interval (currently 15 minutes). This is the default value.
55
- - `false`: do not cache the data; (re)fetch it every time the MFE is loaded
56
- - `-1`: cache the data indefinitely (i.e., for the duration of the user's session)
57
- - _&lt;number&gt;_: cache the data for the specified _&lt;number&gt;_ of milliseconds
54
+ - `true`: cache the data for the standard interval (currently 15 minutes). This is the default value.
55
+ - `false`: do not cache the data; (re)fetch it every time the MFE is loaded
56
+ - `-1`: cache the data indefinitely (i.e., for the duration of the user's session)
57
+ - _&lt;number&gt;_: cache the data for the specified _&lt;number&gt;_ of milliseconds
58
58
 
59
59
  #### Passing data from Host to MFE
60
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-uikit",
3
- "version": "28.3.2",
3
+ "version": "28.4.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,5 +16,5 @@
16
16
  "cli": {
17
17
  "webpack": false
18
18
  },
19
- "gitHead": "5d08d5e03bad6ad8aed0a1b0c92952b3b29a930b"
19
+ "gitHead": "051b5b2f70ae6be345aa08ffdd49d8c049272940"
20
20
  }