diff --git a/documentation/docs/api/classes/BrowserRouter.md b/documentation/docs/api/classes/BrowserRouter.md index d781fa37..f670c30b 100644 --- a/documentation/docs/api/classes/BrowserRouter.md +++ b/documentation/docs/api/classes/BrowserRouter.md @@ -30,7 +30,7 @@ React.Component.constructor #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:482 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:472 • **new BrowserRouter**(`props`, `context`) @@ -51,13 +51,13 @@ React.Component.constructor #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:487 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:477 ## Properties ### context -• **context**: `any` +• **context**: `unknown` If using the new style context, re-declare this in your class to be the `React.ContextType` of your `static contextType`. @@ -79,13 +79,13 @@ React.Component.context #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:480 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:470 ___ ### props -• `Readonly` **props**: `Readonly`<`BrowserRouterProps`\> & `Readonly`<{ `children?`: `ReactNode` }\> +• `Readonly` **props**: `Readonly`<`BrowserRouterProps`\> #### Inherited from @@ -93,7 +93,7 @@ React.Component.props #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:505 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:490 ___ @@ -114,7 +114,7 @@ React.Component.refs #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:511 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:496 ___ @@ -128,7 +128,7 @@ React.Component.state #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:506 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:491 ___ @@ -161,7 +161,7 @@ React.Component.contextType #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:462 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:453 ## Methods @@ -193,7 +193,7 @@ React.Component.UNSAFE\_componentWillMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:718 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:687 ___ @@ -235,7 +235,7 @@ React.Component.UNSAFE\_componentWillReceiveProps #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:750 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:719 ___ @@ -276,7 +276,7 @@ React.Component.UNSAFE\_componentWillUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:778 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:747 ___ @@ -304,7 +304,7 @@ React.Component.componentDidCatch #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:647 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:616 ___ @@ -324,7 +324,7 @@ React.Component.componentDidMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:626 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:595 ___ @@ -354,7 +354,7 @@ React.Component.componentDidUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:689 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:658 ___ @@ -384,7 +384,7 @@ React.Component.componentWillMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:704 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:673 ___ @@ -424,7 +424,7 @@ React.Component.componentWillReceiveProps #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:733 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:702 ___ @@ -445,7 +445,7 @@ React.Component.componentWillUnmount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:642 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:611 ___ @@ -484,7 +484,7 @@ React.Component.componentWillUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:763 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:732 ___ @@ -508,7 +508,7 @@ React.Component.forceUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:497 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:487 ___ @@ -540,7 +540,7 @@ React.Component.getSnapshotBeforeUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:683 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:652 ___ @@ -558,7 +558,7 @@ React.Component.render #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:498 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:488 ___ @@ -589,7 +589,7 @@ React.Component.setState #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:492 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:482 ___ @@ -624,4 +624,4 @@ React.Component.shouldComponentUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:637 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:606 diff --git a/documentation/docs/api/classes/Redirect.md b/documentation/docs/api/classes/Redirect.md index e5298196..f8444d62 100644 --- a/documentation/docs/api/classes/Redirect.md +++ b/documentation/docs/api/classes/Redirect.md @@ -30,7 +30,7 @@ React.Component.constructor #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:482 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:472 • **new Redirect**(`props`, `context`) @@ -51,13 +51,13 @@ React.Component.constructor #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:487 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:477 ## Properties ### context -• **context**: `any` +• **context**: `unknown` If using the new style context, re-declare this in your class to be the `React.ContextType` of your `static contextType`. @@ -79,13 +79,13 @@ React.Component.context #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:480 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:470 ___ ### props -• `Readonly` **props**: `Readonly`<`RedirectProps`\> & `Readonly`<{ `children?`: `ReactNode` }\> +• `Readonly` **props**: `Readonly`<`RedirectProps`\> #### Inherited from @@ -93,7 +93,7 @@ React.Component.props #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:505 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:490 ___ @@ -114,7 +114,7 @@ React.Component.refs #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:511 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:496 ___ @@ -128,7 +128,7 @@ React.Component.state #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:506 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:491 ___ @@ -161,7 +161,7 @@ React.Component.contextType #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:462 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:453 ## Methods @@ -193,7 +193,7 @@ React.Component.UNSAFE\_componentWillMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:718 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:687 ___ @@ -235,7 +235,7 @@ React.Component.UNSAFE\_componentWillReceiveProps #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:750 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:719 ___ @@ -276,7 +276,7 @@ React.Component.UNSAFE\_componentWillUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:778 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:747 ___ @@ -304,7 +304,7 @@ React.Component.componentDidCatch #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:647 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:616 ___ @@ -324,7 +324,7 @@ React.Component.componentDidMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:626 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:595 ___ @@ -354,7 +354,7 @@ React.Component.componentDidUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:689 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:658 ___ @@ -384,7 +384,7 @@ React.Component.componentWillMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:704 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:673 ___ @@ -424,7 +424,7 @@ React.Component.componentWillReceiveProps #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:733 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:702 ___ @@ -445,7 +445,7 @@ React.Component.componentWillUnmount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:642 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:611 ___ @@ -484,7 +484,7 @@ React.Component.componentWillUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:763 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:732 ___ @@ -508,7 +508,7 @@ React.Component.forceUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:497 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:487 ___ @@ -540,7 +540,7 @@ React.Component.getSnapshotBeforeUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:683 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:652 ___ @@ -558,7 +558,7 @@ React.Component.render #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:498 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:488 ___ @@ -589,7 +589,7 @@ React.Component.setState #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:492 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:482 ___ @@ -624,4 +624,4 @@ React.Component.shouldComponentUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:637 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:606 diff --git a/documentation/docs/api/classes/Route.md b/documentation/docs/api/classes/Route.md index 4322f279..b93f6c0c 100644 --- a/documentation/docs/api/classes/Route.md +++ b/documentation/docs/api/classes/Route.md @@ -47,7 +47,7 @@ React.Component< #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:482 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:472 • **new Route**<`T`, `Path`\>(`props`, `context`) @@ -78,13 +78,13 @@ React.Component< #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:487 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:477 ## Properties ### context -• **context**: `any` +• **context**: `unknown` If using the new style context, re-declare this in your class to be the `React.ContextType` of your `static contextType`. @@ -106,13 +106,13 @@ React.Component.context #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:480 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:470 ___ ### props -• `Readonly` **props**: `Readonly`<`RouteProps`<`Path`, `ExtractRouteParams`<`Path`, `string`\>\> & `OmitNative`<`T`, keyof `RouteProps`<`string`, {}\>\>\> & `Readonly`<{ `children?`: `ReactNode` }\> +• `Readonly` **props**: `Readonly`<`RouteProps`<`Path`, `ExtractRouteParams`<`Path`, `string`\>\> & `OmitNative`<`T`, keyof `RouteProps`<`string`, {}\>\>\> #### Inherited from @@ -120,7 +120,7 @@ React.Component.props #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:505 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:490 ___ @@ -141,7 +141,7 @@ React.Component.refs #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:511 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:496 ___ @@ -155,7 +155,7 @@ React.Component.state #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:506 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:491 ___ @@ -188,7 +188,7 @@ React.Component.contextType #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:462 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:453 ## Methods @@ -220,7 +220,7 @@ React.Component.UNSAFE\_componentWillMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:718 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:687 ___ @@ -262,7 +262,7 @@ React.Component.UNSAFE\_componentWillReceiveProps #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:750 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:719 ___ @@ -303,7 +303,7 @@ React.Component.UNSAFE\_componentWillUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:778 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:747 ___ @@ -331,7 +331,7 @@ React.Component.componentDidCatch #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:647 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:616 ___ @@ -351,7 +351,7 @@ React.Component.componentDidMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:626 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:595 ___ @@ -381,7 +381,7 @@ React.Component.componentDidUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:689 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:658 ___ @@ -411,7 +411,7 @@ React.Component.componentWillMount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:704 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:673 ___ @@ -451,7 +451,7 @@ React.Component.componentWillReceiveProps #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:733 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:702 ___ @@ -472,7 +472,7 @@ React.Component.componentWillUnmount #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:642 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:611 ___ @@ -511,7 +511,7 @@ React.Component.componentWillUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:763 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:732 ___ @@ -535,7 +535,7 @@ React.Component.forceUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:497 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:487 ___ @@ -567,7 +567,7 @@ React.Component.getSnapshotBeforeUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:683 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:652 ___ @@ -585,7 +585,7 @@ React.Component.render #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:498 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:488 ___ @@ -616,7 +616,7 @@ React.Component.setState #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:492 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:482 ___ @@ -651,4 +651,4 @@ React.Component.shouldComponentUpdate #### Defined in -node_modules/@types/react-router/node_modules/@types/react/index.d.ts:637 +node_modules/@types/react-router/node_modules/@types/react/index.d.ts:606 diff --git a/documentation/docs/api/interfaces/AxiosPromise.md b/documentation/docs/api/interfaces/AxiosPromise.md index db8fb936..1fbbb324 100644 --- a/documentation/docs/api/interfaces/AxiosPromise.md +++ b/documentation/docs/api/interfaces/AxiosPromise.md @@ -1,16 +1,16 @@ --- -id: 'AxiosPromise' -title: 'Interface: AxiosPromise' -sidebar_label: 'AxiosPromise' +id: "AxiosPromise" +title: "Interface: AxiosPromise" +sidebar_label: "AxiosPromise" sidebar_position: 0 custom_edit_url: null --- ## Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | ## Hierarchy @@ -26,7 +26,7 @@ custom_edit_url: null #### Inherited from -Promise.\_\_@toStringTag@5622 +Promise.\_\_@toStringTag@6616 #### Defined in @@ -42,15 +42,15 @@ Attaches a callback for only the rejection of the Promise. #### Type parameters -| Name | Type | -| :-------- | :------ | +| Name | Type | +| :------ | :------ | | `TResult` | `never` | #### Parameters -| Name | Type | Description | -| :------------ | :-------------------------------------------------------------------- | :---------------------------------------------------- | -| `onrejected?` | `null` \| (`reason`: `any`) => `TResult` \| `PromiseLike`<`TResult`\> | The callback to execute when the Promise is rejected. | +| Name | Type | Description | +| :------ | :------ | :------ | +| `onrejected?` | ``null`` \| (`reason`: `any`) => `TResult` \| `PromiseLike`<`TResult`\> | The callback to execute when the Promise is rejected. | #### Returns @@ -66,7 +66,7 @@ Promise.catch documentation/node_modules/typescript/lib/lib.es5.d.ts:1509 ---- +___ ### finally @@ -77,9 +77,9 @@ resolved value cannot be modified from the callback. #### Parameters -| Name | Type | Description | -| :----------- | :--------------------- | :--------------------------------------------------------------------------- | -| `onfinally?` | `null` \| () => `void` | The callback to execute when the Promise is settled (fulfilled or rejected). | +| Name | Type | Description | +| :------ | :------ | :------ | +| `onfinally?` | ``null`` \| () => `void` | The callback to execute when the Promise is settled (fulfilled or rejected). | #### Returns @@ -95,7 +95,7 @@ Promise.finally documentation/node_modules/typescript/lib/lib.es2018.promise.d.ts:31 ---- +___ ### then @@ -105,17 +105,17 @@ Attaches callbacks for the resolution and/or rejection of the Promise. #### Type parameters -| Name | Type | -| :--------- | :---------------------------------------- | +| Name | Type | +| :------ | :------ | | `TResult1` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | -| `TResult2` | `never` | +| `TResult2` | `never` | #### Parameters -| Name | Type | Description | -| :------------- | :--------------------------------------------------------------------------------------------------------- | :---------------------------------------------------- | -| `onfulfilled?` | `null` \| (`value`: [`AxiosResponse`](AxiosResponse.md)<`T`\>) => `TResult1` \| `PromiseLike`<`TResult1`\> | The callback to execute when the Promise is resolved. | -| `onrejected?` | `null` \| (`reason`: `any`) => `TResult2` \| `PromiseLike`<`TResult2`\> | The callback to execute when the Promise is rejected. | +| Name | Type | Description | +| :------ | :------ | :------ | +| `onfulfilled?` | ``null`` \| (`value`: [`AxiosResponse`](AxiosResponse.md)<`T`\>) => `TResult1` \| `PromiseLike`<`TResult1`\> | The callback to execute when the Promise is resolved. | +| `onrejected?` | ``null`` \| (`reason`: `any`) => `TResult2` \| `PromiseLike`<`TResult2`\> | The callback to execute when the Promise is rejected. | #### Returns diff --git a/documentation/docs/api/interfaces/AxiosRequestConfig.md b/documentation/docs/api/interfaces/AxiosRequestConfig.md index 9c438c1e..e4f66f2f 100644 --- a/documentation/docs/api/interfaces/AxiosRequestConfig.md +++ b/documentation/docs/api/interfaces/AxiosRequestConfig.md @@ -1,7 +1,7 @@ --- -id: 'AxiosRequestConfig' -title: 'Interface: AxiosRequestConfig' -sidebar_label: 'AxiosRequestConfig' +id: "AxiosRequestConfig" +title: "Interface: AxiosRequestConfig" +sidebar_label: "AxiosRequestConfig" sidebar_position: 0 custom_edit_url: null --- @@ -16,7 +16,7 @@ custom_edit_url: null node_modules/axios/index.d.ts:63 ---- +___ ### auth @@ -26,7 +26,7 @@ node_modules/axios/index.d.ts:63 node_modules/axios/index.d.ts:64 ---- +___ ### baseURL @@ -36,7 +36,7 @@ node_modules/axios/index.d.ts:64 node_modules/axios/index.d.ts:53 ---- +___ ### cancelToken @@ -46,7 +46,7 @@ node_modules/axios/index.d.ts:53 node_modules/axios/index.d.ts:78 ---- +___ ### data @@ -56,7 +56,7 @@ node_modules/axios/index.d.ts:78 node_modules/axios/index.d.ts:59 ---- +___ ### decompress @@ -66,7 +66,7 @@ node_modules/axios/index.d.ts:59 node_modules/axios/index.d.ts:79 ---- +___ ### headers @@ -76,7 +76,7 @@ node_modules/axios/index.d.ts:79 node_modules/axios/index.d.ts:56 ---- +___ ### httpAgent @@ -86,7 +86,7 @@ node_modules/axios/index.d.ts:56 node_modules/axios/index.d.ts:75 ---- +___ ### httpsAgent @@ -96,7 +96,7 @@ node_modules/axios/index.d.ts:75 node_modules/axios/index.d.ts:76 ---- +___ ### maxBodyLength @@ -106,7 +106,7 @@ node_modules/axios/index.d.ts:76 node_modules/axios/index.d.ts:72 ---- +___ ### maxContentLength @@ -116,7 +116,7 @@ node_modules/axios/index.d.ts:72 node_modules/axios/index.d.ts:70 ---- +___ ### maxRedirects @@ -126,7 +126,7 @@ node_modules/axios/index.d.ts:70 node_modules/axios/index.d.ts:73 ---- +___ ### method @@ -136,7 +136,7 @@ node_modules/axios/index.d.ts:73 node_modules/axios/index.d.ts:52 ---- +___ ### params @@ -146,17 +146,17 @@ node_modules/axios/index.d.ts:52 node_modules/axios/index.d.ts:57 ---- +___ ### proxy -• `Optional` **proxy**: `false` \| [`AxiosProxyConfig`](AxiosProxyConfig.md) +• `Optional` **proxy**: ``false`` \| [`AxiosProxyConfig`](AxiosProxyConfig.md) #### Defined in node_modules/axios/index.d.ts:77 ---- +___ ### responseType @@ -166,17 +166,17 @@ node_modules/axios/index.d.ts:77 node_modules/axios/index.d.ts:65 ---- +___ ### socketPath -• `Optional` **socketPath**: `null` \| `string` +• `Optional` **socketPath**: ``null`` \| `string` #### Defined in node_modules/axios/index.d.ts:74 ---- +___ ### timeout @@ -186,7 +186,7 @@ node_modules/axios/index.d.ts:74 node_modules/axios/index.d.ts:60 ---- +___ ### timeoutErrorMessage @@ -196,7 +196,7 @@ node_modules/axios/index.d.ts:60 node_modules/axios/index.d.ts:61 ---- +___ ### transformRequest @@ -206,7 +206,7 @@ node_modules/axios/index.d.ts:61 node_modules/axios/index.d.ts:54 ---- +___ ### transformResponse @@ -216,7 +216,7 @@ node_modules/axios/index.d.ts:54 node_modules/axios/index.d.ts:55 ---- +___ ### transitional @@ -226,7 +226,7 @@ node_modules/axios/index.d.ts:55 node_modules/axios/index.d.ts:80 ---- +___ ### url @@ -236,17 +236,17 @@ node_modules/axios/index.d.ts:80 node_modules/axios/index.d.ts:51 ---- +___ ### validateStatus -• `Optional` **validateStatus**: `null` \| (`status`: `number`) => `boolean` +• `Optional` **validateStatus**: ``null`` \| (`status`: `number`) => `boolean` #### Defined in node_modules/axios/index.d.ts:71 ---- +___ ### withCredentials @@ -256,7 +256,7 @@ node_modules/axios/index.d.ts:71 node_modules/axios/index.d.ts:62 ---- +___ ### xsrfCookieName @@ -266,7 +266,7 @@ node_modules/axios/index.d.ts:62 node_modules/axios/index.d.ts:66 ---- +___ ### xsrfHeaderName @@ -284,8 +284,8 @@ node_modules/axios/index.d.ts:67 #### Parameters -| Name | Type | -| :-------------- | :---- | +| Name | Type | +| :------ | :------ | | `progressEvent` | `any` | #### Returns @@ -296,7 +296,7 @@ node_modules/axios/index.d.ts:67 node_modules/axios/index.d.ts:69 ---- +___ ### onUploadProgress @@ -304,8 +304,8 @@ node_modules/axios/index.d.ts:69 #### Parameters -| Name | Type | -| :-------------- | :---- | +| Name | Type | +| :------ | :------ | | `progressEvent` | `any` | #### Returns @@ -316,7 +316,7 @@ node_modules/axios/index.d.ts:69 node_modules/axios/index.d.ts:68 ---- +___ ### paramsSerializer @@ -324,8 +324,8 @@ node_modules/axios/index.d.ts:68 #### Parameters -| Name | Type | -| :------- | :---- | +| Name | Type | +| :------ | :------ | | `params` | `any` | #### Returns diff --git a/documentation/docs/api/interfaces/AxiosStatic.md b/documentation/docs/api/interfaces/AxiosStatic.md index 70bb94b2..52d7e3ac 100644 --- a/documentation/docs/api/interfaces/AxiosStatic.md +++ b/documentation/docs/api/interfaces/AxiosStatic.md @@ -1,7 +1,7 @@ --- -id: 'AxiosStatic' -title: 'Interface: AxiosStatic' -sidebar_label: 'AxiosStatic' +id: "AxiosStatic" +title: "Interface: AxiosStatic" +sidebar_label: "AxiosStatic" sidebar_position: 0 custom_edit_url: null --- @@ -20,8 +20,8 @@ custom_edit_url: null #### Parameters -| Name | Type | -| :------- | :-------------------------------------------- | +| Name | Type | +| :------ | :------ | | `config` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -38,9 +38,9 @@ node_modules/axios/index.d.ts:138 #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `url` | `string` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -61,7 +61,7 @@ node_modules/axios/index.d.ts:139 node_modules/axios/index.d.ts:158 ---- +___ ### CancelToken @@ -71,7 +71,7 @@ node_modules/axios/index.d.ts:158 node_modules/axios/index.d.ts:159 ---- +___ ### defaults @@ -85,7 +85,7 @@ node_modules/axios/index.d.ts:159 node_modules/axios/index.d.ts:140 ---- +___ ### interceptors @@ -93,10 +93,10 @@ node_modules/axios/index.d.ts:140 #### Type declaration -| Name | Type | -| :--------- | :------------------------------------------------------------------------------------------------------ | -| `request` | [`AxiosInterceptorManager`](AxiosInterceptorManager.md)<[`AxiosRequestConfig`](AxiosRequestConfig.md)\> | -| `response` | [`AxiosInterceptorManager`](AxiosInterceptorManager.md)<[`AxiosResponse`](AxiosResponse.md)<`any`\>\> | +| Name | Type | +| :------ | :------ | +| `request` | [`AxiosInterceptorManager`](AxiosInterceptorManager.md)<[`AxiosRequestConfig`](AxiosRequestConfig.md)\> | +| `response` | [`AxiosInterceptorManager`](AxiosInterceptorManager.md)<[`AxiosResponse`](AxiosResponse.md)<`any`\>\> | #### Inherited from @@ -115,13 +115,13 @@ node_modules/axios/index.d.ts:141 #### Type parameters | Name | -| :--- | -| `T` | +| :------ | +| `T` | #### Parameters -| Name | Type | -| :------- | :------------------------- | +| Name | Type | +| :------ | :------ | | `values` | (`T` \| `Promise`<`T`\>)[] | #### Returns @@ -132,7 +132,7 @@ node_modules/axios/index.d.ts:141 node_modules/axios/index.d.ts:161 ---- +___ ### create @@ -140,8 +140,8 @@ node_modules/axios/index.d.ts:161 #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | +| Name | Type | +| :------ | :------ | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -152,7 +152,7 @@ node_modules/axios/index.d.ts:161 node_modules/axios/index.d.ts:157 ---- +___ ### delete @@ -160,16 +160,16 @@ node_modules/axios/index.d.ts:157 #### Type parameters -| Name | Type | -| :--- | :---------------------------------------- | -| `T` | `any` | -| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | +| Name | Type | +| :------ | :------ | +| `T` | `any` | +| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `url` | `string` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -184,7 +184,7 @@ node_modules/axios/index.d.ts:157 node_modules/axios/index.d.ts:148 ---- +___ ### get @@ -192,16 +192,16 @@ node_modules/axios/index.d.ts:148 #### Type parameters -| Name | Type | -| :--- | :---------------------------------------- | -| `T` | `any` | -| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | +| Name | Type | +| :------ | :------ | +| `T` | `any` | +| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `url` | `string` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -216,7 +216,7 @@ node_modules/axios/index.d.ts:148 node_modules/axios/index.d.ts:147 ---- +___ ### getUri @@ -224,8 +224,8 @@ node_modules/axios/index.d.ts:147 #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | +| Name | Type | +| :------ | :------ | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -240,7 +240,7 @@ node_modules/axios/index.d.ts:147 node_modules/axios/index.d.ts:145 ---- +___ ### head @@ -248,16 +248,16 @@ node_modules/axios/index.d.ts:145 #### Type parameters -| Name | Type | -| :--- | :---------------------------------------- | -| `T` | `any` | -| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | +| Name | Type | +| :------ | :------ | +| `T` | `any` | +| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `url` | `string` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -272,7 +272,7 @@ node_modules/axios/index.d.ts:145 node_modules/axios/index.d.ts:149 ---- +___ ### isAxiosError @@ -280,8 +280,8 @@ node_modules/axios/index.d.ts:149 #### Parameters -| Name | Type | -| :-------- | :---- | +| Name | Type | +| :------ | :------ | | `payload` | `any` | #### Returns @@ -292,7 +292,7 @@ payload is AxiosError node_modules/axios/index.d.ts:163 ---- +___ ### isCancel @@ -300,8 +300,8 @@ node_modules/axios/index.d.ts:163 #### Parameters -| Name | Type | -| :------ | :---- | +| Name | Type | +| :------ | :------ | | `value` | `any` | #### Returns @@ -312,7 +312,7 @@ node_modules/axios/index.d.ts:163 node_modules/axios/index.d.ts:160 ---- +___ ### options @@ -320,16 +320,16 @@ node_modules/axios/index.d.ts:160 #### Type parameters -| Name | Type | -| :--- | :---------------------------------------- | -| `T` | `any` | -| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | +| Name | Type | +| :------ | :------ | +| `T` | `any` | +| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `url` | `string` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -344,7 +344,7 @@ node_modules/axios/index.d.ts:160 node_modules/axios/index.d.ts:150 ---- +___ ### patch @@ -352,17 +352,17 @@ node_modules/axios/index.d.ts:150 #### Type parameters -| Name | Type | -| :--- | :---------------------------------------- | -| `T` | `any` | -| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | +| Name | Type | +| :------ | :------ | +| `T` | `any` | +| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `url` | `string` | -| `data?` | `any` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | +| `data?` | `any` | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -377,7 +377,7 @@ node_modules/axios/index.d.ts:150 node_modules/axios/index.d.ts:153 ---- +___ ### post @@ -385,17 +385,17 @@ node_modules/axios/index.d.ts:153 #### Type parameters -| Name | Type | -| :--- | :---------------------------------------- | -| `T` | `any` | -| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | +| Name | Type | +| :------ | :------ | +| `T` | `any` | +| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `url` | `string` | -| `data?` | `any` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | +| `data?` | `any` | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -410,7 +410,7 @@ node_modules/axios/index.d.ts:153 node_modules/axios/index.d.ts:151 ---- +___ ### put @@ -418,17 +418,17 @@ node_modules/axios/index.d.ts:151 #### Type parameters -| Name | Type | -| :--- | :---------------------------------------- | -| `T` | `any` | -| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | +| Name | Type | +| :------ | :------ | +| `T` | `any` | +| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `url` | `string` | -| `data?` | `any` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | +| `data?` | `any` | | `config?` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -443,7 +443,7 @@ node_modules/axios/index.d.ts:151 node_modules/axios/index.d.ts:152 ---- +___ ### request @@ -451,15 +451,15 @@ node_modules/axios/index.d.ts:152 #### Type parameters -| Name | Type | -| :--- | :---------------------------------------- | -| `T` | `any` | -| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | +| Name | Type | +| :------ | :------ | +| `T` | `any` | +| `R` | [`AxiosResponse`](AxiosResponse.md)<`T`\> | #### Parameters -| Name | Type | -| :------- | :-------------------------------------------- | +| Name | Type | +| :------ | :------ | | `config` | [`AxiosRequestConfig`](AxiosRequestConfig.md) | #### Returns @@ -474,7 +474,7 @@ node_modules/axios/index.d.ts:152 node_modules/axios/index.d.ts:146 ---- +___ ### spread @@ -483,14 +483,14 @@ node_modules/axios/index.d.ts:146 #### Type parameters | Name | -| :--- | -| `T` | -| `R` | +| :------ | +| `T` | +| `R` | #### Parameters -| Name | Type | -| :--------- | :------------------------ | +| Name | Type | +| :------ | :------ | | `callback` | (...`args`: `T`[]) => `R` | #### Returns @@ -501,8 +501,8 @@ node_modules/axios/index.d.ts:146 ##### Parameters -| Name | Type | -| :------ | :---- | +| Name | Type | +| :------ | :------ | | `array` | `T`[] | ##### Returns diff --git a/documentation/docs/api/modules.md b/documentation/docs/api/modules.md index aadd26f4..f87c6367 100644 --- a/documentation/docs/api/modules.md +++ b/documentation/docs/api/modules.md @@ -1,7 +1,7 @@ --- -id: 'modules' -title: '@orfium/toolbox' -sidebar_label: 'Exports' +id: "modules" +title: "@orfium/toolbox" +sidebar_label: "Exports" sidebar_position: 0.5 custom_edit_url: null --- @@ -41,6 +41,7 @@ custom_edit_url: null - [createAPIInstance](modules.md#createapiinstance-4) - [useAuthentication](modules.md#useauthentication-4) +- [useOrganization](modules.md#useorganization-4) ## component Functions @@ -54,20 +55,20 @@ custom_edit_url: null #### Type declaration -| Name | Type | -| :----------------------- | :------------------------------------------------------------------------------------------------------------------------- | -| `isAuthenticated` | `boolean` | -| `isLoading` | `boolean` | -| `user` | `User` \| `undefined` | -| `getAccessTokenSilently` | (`opts?`: `GetTokenSilentlyOptions`) => `Promise`<{ `decodedToken`: `Record`<`string`, `unknown`\> ; `token`: `string` }\> | -| `loginWithRedirect` | (`o?`: `RedirectLoginOptions`<`any`\>) => `Promise`<`void`\> | -| `logout` | () => `void` | +| Name | Type | +| :------ | :------ | +| `isAuthenticated` | `boolean` | +| `isLoading` | `boolean` | +| `user` | [`User`](modules.md#user-4) \| `undefined` | +| `getAccessTokenSilently` | (`opts?`: `GetTokenSilentlyOptions`) => `Promise`<{ `decodedToken`: [`DecodedTokenResponse`](modules.md#decodedtokenresponse-4) \| `Record`<`string`, `never`\> ; `token`: `string` }\> | +| `loginWithRedirect` | (`o?`: `RedirectLoginOptions`<`any`\>) => `Promise`<`void`\> | +| `logout` | () => `void` | #### Defined in -[src/authentication/types.ts:8](https://github.com/Orfium/toolbox/blob/4bb3226/src/authentication/types.ts#L8) +[src/authentication/types.ts:45](https://github.com/Orfium/toolbox/blob/de159ce/src/authentication/types.ts#L45) ---- +___ ### AuthenticationProviderProps @@ -75,19 +76,19 @@ custom_edit_url: null #### Type declaration -| Name | Type | -| :----------- | :------------------- | +| Name | Type | +| :------ | :------ | | `overrides?` | `Auth0ClientOptions` | #### Defined in -[src/authentication/types.ts:19](https://github.com/Orfium/toolbox/blob/4bb3226/src/authentication/types.ts#L19) +[src/authentication/types.ts:56](https://github.com/Orfium/toolbox/blob/de159ce/src/authentication/types.ts#L56) ---- +___ ### Authorization -Ƭ **Authorization**: `"anonymous"` \| `"authorized"` \| `"unauthorized"` +Ƭ **Authorization**: ``"anonymous"`` \| ``"authorized"`` \| ``"unauthorized"`` **`anonymous:`** general users that can view only public pages - default for all routes without authorization @@ -97,9 +98,9 @@ custom_edit_url: null #### Defined in -[src/routing/Routing.tsx:14](https://github.com/Orfium/toolbox/blob/4bb3226/src/routing/Routing.tsx#L14) +[src/routing/Routing.tsx:14](https://github.com/Orfium/toolbox/blob/de159ce/src/routing/Routing.tsx#L14) ---- +___ ### CreateAPIInstanceProps @@ -107,17 +108,17 @@ custom_edit_url: null #### Type declaration -| Name | Type | -| :------------------- | :------------------------------------------- | -| `baseHeaders?` | `Record`<`string`, `string` \| `undefined`\> | -| `baseUrl` | `string` | -| `hasAutomaticToken?` | `boolean` | +| Name | Type | +| :------ | :------ | +| `baseHeaders?` | `Record`<`string`, `string` \| `undefined`\> | +| `baseUrl` | `string` | +| `hasAutomaticToken?` | `boolean` | #### Defined in -[src/request/createAPIInstance.ts:8](https://github.com/Orfium/toolbox/blob/4bb3226/src/request/createAPIInstance.ts#L8) +[src/request/createAPIInstance.ts:8](https://github.com/Orfium/toolbox/blob/de159ce/src/request/createAPIInstance.ts#L8) ---- +___ ### CreateAPIInstanceType @@ -125,22 +126,46 @@ custom_edit_url: null #### Type declaration -| Name | Type | -| :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `instance` | [`AxiosInstance`](interfaces/AxiosInstance.md) | -| `createRequest` | (`props`: [`RequestProps`](modules.md#requestprops-4)) => { `cancelTokenSource`: [`CancelTokenSource`](interfaces/CancelTokenSource.md) ; `request`: () => `Promise`<`T`\> } | -| `deleteToken` | () => `void` | -| `setToken` | (`token`: `string`) => `void` | +| Name | Type | +| :------ | :------ | +| `instance` | [`AxiosInstance`](interfaces/AxiosInstance.md) | +| `createRequest` | (`props`: [`RequestProps`](modules.md#requestprops-4)) => { `cancelTokenSource`: [`CancelTokenSource`](interfaces/CancelTokenSource.md) ; `request`: () => `Promise`<`T`\> } | +| `deleteToken` | () => `void` | +| `setToken` | (`token`: `string`) => `void` | #### Defined in -[src/request/createAPIInstance.ts:14](https://github.com/Orfium/toolbox/blob/4bb3226/src/request/createAPIInstance.ts#L14) +[src/request/createAPIInstance.ts:14](https://github.com/Orfium/toolbox/blob/de159ce/src/request/createAPIInstance.ts#L14) ---- +___ + +### DecodedTokenResponse + +Ƭ **DecodedTokenResponse**: `Object` + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `aud?` | `string`[] | - | +| `azp?` | `string` | - | +| `exp?` | `number` | - | +| `iat?` | `number` | - | +| `iss?` | `string` | - | +| `org_id?` | `string` | the organization id of the user currently selected | +| `permissions?` | `string`[] | the permissions defined on the user for more info visit https://orfium.atlassian.net/wiki/spaces/OPS/pages/2554134739/Roles+and+Permissions#Organization-Roles | +| `scope?` | `string` | - | +| `sub?` | `string` | - | + +#### Defined in + +[src/authentication/types.ts:7](https://github.com/Orfium/toolbox/blob/de159ce/src/authentication/types.ts#L7) + +___ ### FallbackPath -Ƭ **FallbackPath**: `"unauthenticated"` \| `"unauthorized"` \| `"authenticatedButAnonymous"` +Ƭ **FallbackPath**: ``"unauthenticated"`` \| ``"unauthorized"`` \| ``"authenticatedButAnonymous"`` **`unauthenticated:`** in case a user visits a path and has no authentication @@ -150,19 +175,19 @@ custom_edit_url: null #### Defined in -[src/routing/Routing.tsx:22](https://github.com/Orfium/toolbox/blob/4bb3226/src/routing/Routing.tsx#L22) +[src/routing/Routing.tsx:22](https://github.com/Orfium/toolbox/blob/de159ce/src/routing/Routing.tsx#L22) ---- +___ ### Method -Ƭ **Method**: `"get"` \| `"GET"` \| `"delete"` \| `"DELETE"` \| `"head"` \| `"HEAD"` \| `"options"` \| `"OPTIONS"` \| `"post"` \| `"POST"` \| `"put"` \| `"PUT"` \| `"patch"` \| `"PATCH"` \| `"purge"` \| `"PURGE"` \| `"link"` \| `"LINK"` \| `"unlink"` \| `"UNLINK"` +Ƭ **Method**: ``"get"`` \| ``"GET"`` \| ``"delete"`` \| ``"DELETE"`` \| ``"head"`` \| ``"HEAD"`` \| ``"options"`` \| ``"OPTIONS"`` \| ``"post"`` \| ``"POST"`` \| ``"put"`` \| ``"PUT"`` \| ``"patch"`` \| ``"PATCH"`` \| ``"purge"`` \| ``"PURGE"`` \| ``"link"`` \| ``"LINK"`` \| ``"unlink"`` \| ``"UNLINK"`` #### Defined in node_modules/axios/index.d.ts:24 ---- +___ ### MockRequest @@ -170,9 +195,9 @@ node_modules/axios/index.d.ts:24 #### Defined in -[src/request/mock.ts:3](https://github.com/Orfium/toolbox/blob/4bb3226/src/request/mock.ts#L3) +[src/request/mock.ts:3](https://github.com/Orfium/toolbox/blob/de159ce/src/request/mock.ts#L3) ---- +___ ### Organization @@ -180,47 +205,47 @@ node_modules/axios/index.d.ts:24 #### Type declaration -| Name | Type | -| :----------------------- | :----------------------------------------------- | -| `branding` | { `logo_url`: `string` } | -| `branding.logo_url` | `string` | -| `can_administrate` | `boolean` | -| `display_name` | `string` | -| `metadata` | { `product_codes`: `string` ; `type`: `string` } | -| `metadata.product_codes` | `string` | -| `metadata.type` | `string` | -| `name` | `string` | -| `org_id` | `string` | +| Name | Type | +| :------ | :------ | +| `branding` | { `logo_url`: `string` } | +| `branding.logo_url` | `string` | +| `can_administrate` | `boolean` | +| `display_name` | `string` | +| `metadata` | { `product_codes`: `string` ; `type`: `string` } | +| `metadata.product_codes` | `string` | +| `metadata.type` | `string` | +| `name` | `string` | +| `org_id` | `string` | #### Defined in -[src/store/useOrganization.ts:4](https://github.com/Orfium/toolbox/blob/4bb3226/src/store/useOrganization.ts#L4) +[src/store/useOrganization.ts:4](https://github.com/Orfium/toolbox/blob/de159ce/src/store/useOrganization.ts#L4) ---- +___ ### RequestProps -Ƭ **RequestProps**: { `headers?`: `Record`<`string`, `unknown`\> ; `method`: `Methods` ; `params?`: `Record`<`string`, `unknown`\> ; `url`: `string` } & `Pick`<[`AxiosRequestConfig`](interfaces/AxiosRequestConfig.md), `"onUploadProgress"` \| `"onDownloadProgress"` \| `"responseType"`\> +Ƭ **RequestProps**: { `headers?`: `Record`<`string`, `unknown`\> ; `method`: `Methods` ; `params?`: `Record`<`string`, `unknown`\> ; `url`: `string` } & `Pick`<[`AxiosRequestConfig`](interfaces/AxiosRequestConfig.md), ``"onUploadProgress"`` \| ``"onDownloadProgress"`` \| ``"responseType"``\> #### Defined in -[src/request/request.ts:16](https://github.com/Orfium/toolbox/blob/4bb3226/src/request/request.ts#L16) +[src/request/request.ts:16](https://github.com/Orfium/toolbox/blob/de159ce/src/request/request.ts#L16) ---- +___ ### ResponseType -Ƭ **ResponseType**: `"arraybuffer"` \| `"blob"` \| `"document"` \| `"json"` \| `"text"` \| `"stream"` +Ƭ **ResponseType**: ``"arraybuffer"`` \| ``"blob"`` \| ``"document"`` \| ``"json"`` \| ``"text"`` \| ``"stream"`` #### Defined in node_modules/axios/index.d.ts:36 ---- +___ ### RouteComponentProps -Ƭ **RouteComponentProps**<`T`\>: `ReactRouterRouteComponentProps`<`any`\> & { `extraProps`: `T` } +Ƭ **RouteComponentProps**<`T`\>: `ReactRouterRouteComponentProps`<`any`\> & { `extraProps`: `T` } This is actual part of the library so you can skip it. An extension of the React Router Component props to be used with the extra props. @@ -228,15 +253,15 @@ Is being used to the route component to extend its functionality on types #### Type parameters -| Name | Type | -| :--- | :-------- | -| `T` | `unknown` | +| Name | Type | +| :------ | :------ | +| `T` | `unknown` | #### Defined in -[src/routing/Routing.tsx:35](https://github.com/Orfium/toolbox/blob/4bb3226/src/routing/Routing.tsx#L35) +[src/routing/Routing.tsx:35](https://github.com/Orfium/toolbox/blob/de159ce/src/routing/Routing.tsx#L35) ---- +___ ### RouteItem @@ -244,18 +269,18 @@ Is being used to the route component to extend its functionality on types #### Type declaration -| Name | Type | Description | -| :--------------- | :------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------- | -| `authorization?` | [`Authorization`](modules.md#authorization-4) | The authorization level of the route, there are 3: 'anonymous' \| 'authorized' \| 'unauthorized' - **`defaultvalue:`** 'anonymous' | -| `component?` | `React.FunctionComponent`<[`RouteComponentProps`](modules.md#routecomponentprops-4)\> | A component that the route renders as page. This has all the props and extraProps that have been passed to that route | -| `extraProps?` | `unknown` | Any custom/extra props that are going to be available on the component | -| `path` | `string` \| `string`[] | The url path or paths of the route that will listen to in order to render | +| Name | Type | Description | +| :------ | :------ | :------ | +| `authorization?` | [`Authorization`](modules.md#authorization-4) | The authorization level of the route, there are 3: 'anonymous' \| 'authorized' \| 'unauthorized' - **`defaultvalue:`** 'anonymous' | +| `component?` | `React.FunctionComponent`<[`RouteComponentProps`](modules.md#routecomponentprops-4)\> | A component that the route renders as page. This has all the props and extraProps that have been passed to that route | +| `extraProps?` | `unknown` | Any custom/extra props that are going to be available on the component | +| `path` | `string` \| `string`[] | The url path or paths of the route that will listen to in order to render | #### Defined in -[src/routing/Routing.tsx:41](https://github.com/Orfium/toolbox/blob/4bb3226/src/routing/Routing.tsx#L41) +[src/routing/Routing.tsx:41](https://github.com/Orfium/toolbox/blob/de159ce/src/routing/Routing.tsx#L41) ---- +___ ### RoutingStructure @@ -263,24 +288,63 @@ Is being used to the route component to extend its functionality on types #### Type declaration -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `fallbackPaths?` | `Partial`<`Record`<[`FallbackPath`](modules.md#fallbackpath-4), `string`\>\> | Holder of paths relative to the types of authorization. For every type there is a fallback path that a user will be redirected if they don't have access to it based on the authorization | -| `routes` | [`RouteItem`](modules.md#routeitem-4)[] | - | +| `routes` | [`RouteItem`](modules.md#routeitem-4)[] | - | #### Defined in -[src/routing/Routing.tsx:24](https://github.com/Orfium/toolbox/blob/4bb3226/src/routing/Routing.tsx#L24) +[src/routing/Routing.tsx:24](https://github.com/Orfium/toolbox/blob/de159ce/src/routing/Routing.tsx#L24) ---- +___ ### TopBarProps -Ƭ **TopBarProps**: { `logoIcon`: `JSX.Element` ; `userMenu?`: `never` } & `Omit`<`TopAppBarProps`, `"logoIcon"` \| `"userMenu"`\> +Ƭ **TopBarProps**: { `logoIcon`: `JSX.Element` ; `userMenu?`: `never` } & `Omit`<`TopAppBarProps`, ``"logoIcon"`` \| ``"userMenu"``\> + +#### Defined in + +[src/authentication/components/TopBar/TopBar.tsx:8](https://github.com/Orfium/toolbox/blob/de159ce/src/authentication/components/TopBar/TopBar.tsx#L8) + +___ + +### User + +Ƭ **User**: `Object` + +#### Index signature + +▪ [key: `string`]: `any` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `address?` | `string` | +| `birthdate?` | `string` | +| `email?` | `string` | +| `email_verified?` | `boolean` | +| `family_name?` | `string` | +| `gender?` | `string` | +| `given_name?` | `string` | +| `locale?` | `string` | +| `middle_name?` | `string` | +| `name?` | `string` | +| `nickname?` | `string` | +| `phone_number?` | `string` | +| `phone_number_verified?` | `boolean` | +| `picture?` | `string` | +| `preferred_username?` | `string` | +| `profile?` | `string` | +| `sub?` | `string` | +| `updated_at?` | `string` | +| `website?` | `string` | +| `zoneinfo?` | `string` | #### Defined in -[src/authentication/TopBar.tsx:9](https://github.com/Orfium/toolbox/blob/4bb3226/src/authentication/TopBar.tsx#L9) +[src/authentication/types.ts:21](https://github.com/Orfium/toolbox/blob/de159ce/src/authentication/types.ts#L21) ## Variables @@ -290,9 +354,9 @@ Is being used to the route component to extend its functionality on types #### Defined in -[src/authentication/Authentication.tsx:18](https://github.com/Orfium/toolbox/blob/4bb3226/src/authentication/Authentication.tsx#L18) +[src/authentication/Authentication.tsx:22](https://github.com/Orfium/toolbox/blob/de159ce/src/authentication/Authentication.tsx#L22) ---- +___ ### AuthenticationProvider @@ -300,9 +364,9 @@ Is being used to the route component to extend its functionality on types #### Defined in -[src/authentication/context.tsx:115](https://github.com/Orfium/toolbox/blob/4bb3226/src/authentication/context.tsx#L115) +[src/authentication/context.tsx:130](https://github.com/Orfium/toolbox/blob/de159ce/src/authentication/context.tsx#L130) ---- +___ ### METHODS @@ -310,9 +374,9 @@ Is being used to the route component to extend its functionality on types #### Defined in -[src/request/request.ts:14](https://github.com/Orfium/toolbox/blob/4bb3226/src/request/request.ts#L14) +[src/request/request.ts:14](https://github.com/Orfium/toolbox/blob/de159ce/src/request/request.ts#L14) ---- +___ ### MockRequest @@ -320,27 +384,9 @@ Is being used to the route component to extend its functionality on types #### Defined in -[src/request/mock.ts:4](https://github.com/Orfium/toolbox/blob/4bb3226/src/request/mock.ts#L4) - ---- - -### default - -• **default**: `Object` - -#### Type declaration - -| Name | Type | -| :------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `useOrganization` | { `organizations`: [`Organization`](modules.md#organization-2)[] ; `selectedOrganization`: `undefined` \| [`Organization`](modules.md#organization-2) } | -| `useOrganization.organizations` | [`Organization`](modules.md#organization-2)[] | -| `useOrganization.selectedOrganization` | `undefined` \| [`Organization`](modules.md#organization-2) | - -#### Defined in - -[src/index.ts:9](https://github.com/Orfium/toolbox/blob/4bb3226/src/index.ts#L9) +[src/request/mock.ts:4](https://github.com/Orfium/toolbox/blob/de159ce/src/request/mock.ts#L4) ---- +___ ### orfiumIdBaseInstance @@ -348,7 +394,7 @@ Is being used to the route component to extend its functionality on types #### Defined in -[src/request/index.ts:6](https://github.com/Orfium/toolbox/blob/4bb3226/src/request/index.ts#L6) +[src/request/index.ts:6](https://github.com/Orfium/toolbox/blob/de159ce/src/request/index.ts#L6) ## Other Functions @@ -358,8 +404,8 @@ Is being used to the route component to extend its functionality on types #### Parameters -| Name | Type | -| :------------------ | :-------------------------------------------------------------- | +| Name | Type | +| :------ | :------ | | `__namedParameters` | [`CreateAPIInstanceProps`](modules.md#createapiinstanceprops-4) | #### Returns @@ -368,9 +414,9 @@ Is being used to the route component to extend its functionality on types #### Defined in -[src/request/createAPIInstance.ts:31](https://github.com/Orfium/toolbox/blob/4bb3226/src/request/createAPIInstance.ts#L31) +[src/request/createAPIInstance.ts:31](https://github.com/Orfium/toolbox/blob/de159ce/src/request/createAPIInstance.ts#L31) ---- +___ ### useAuthentication @@ -382,9 +428,28 @@ Is being used to the route component to extend its functionality on types #### Defined in -[src/authentication/context.tsx:192](https://github.com/Orfium/toolbox/blob/4bb3226/src/authentication/context.tsx#L192) +[src/authentication/context.tsx:248](https://github.com/Orfium/toolbox/blob/de159ce/src/authentication/context.tsx#L248) ---- +___ + +### useOrganization + +▸ **useOrganization**(): `Object` + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `organizations` | [`Organization`](modules.md#organization-4)[] | +| `selectedOrganization` | `undefined` \| [`Organization`](modules.md#organization-4) | + +#### Defined in + +[src/index.ts:8](https://github.com/Orfium/toolbox/blob/de159ce/src/index.ts#L8) + +___ ## component Functions @@ -398,12 +463,12 @@ If the fallbacks are defined then those will be used instead. #### Parameters -| Name | Type | Description | -| :------------------------- | :-------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- | -| `props` | `Object` | Component properties | -| `props.fallbackComponent?` | `ComponentType`<{}\> | The component that will render if none of the routes match the url location - @default Page not found | -| `props.isAuthenticated` | `boolean` | A boolean that are passed from the parent Application to let the generation of routes know the state of the user | -| `props.structure` | [`RoutingStructure`](modules.md#routingstructure-4) | A list of Routes that needs to render with authorization level and extra props. | +| Name | Type | Description | +| :------ | :------ | :------ | +| `props` | `Object` | Component properties | +| `props.fallbackComponent?` | `ComponentType`<{}\> | The component that will render if none of the routes match the url location - @default Page not found | +| `props.isAuthenticated` | `boolean` | A boolean that are passed from the parent Application to let the generation of routes know the state of the user | +| `props.structure` | [`RoutingStructure`](modules.md#routingstructure-4) | A list of Routes that needs to render with authorization level and extra props. | #### Returns @@ -411,4 +476,4 @@ If the fallbacks are defined then those will be used instead. #### Defined in -[src/routing/Routing.tsx:62](https://github.com/Orfium/toolbox/blob/4bb3226/src/routing/Routing.tsx#L62) +[src/routing/Routing.tsx:62](https://github.com/Orfium/toolbox/blob/de159ce/src/routing/Routing.tsx#L62) diff --git a/documentation/docs/api/namespaces/Authentication.md b/documentation/docs/api/namespaces/Authentication.md index d738cd47..1121cf19 100644 --- a/documentation/docs/api/namespaces/Authentication.md +++ b/documentation/docs/api/namespaces/Authentication.md @@ -1,7 +1,7 @@ --- -id: 'Authentication' -title: 'Namespace: Authentication' -sidebar_label: 'Authentication' +id: "Authentication" +title: "Namespace: Authentication" +sidebar_label: "Authentication" sidebar_position: 0 custom_edit_url: null --- diff --git a/documentation/docs/modules/Authentication/faq.md b/documentation/docs/modules/Authentication/faq.md index ef265d09..74bb5880 100644 --- a/documentation/docs/modules/Authentication/faq.md +++ b/documentation/docs/modules/Authentication/faq.md @@ -9,6 +9,10 @@ sidebar_position: 3 Make sure you have a `.env` or `.env.local` on your project and you set up the enviroment variables correctly on the first step. +### How i can filter based on user permissions? + +To use the current user permissions you must use the `decodedToken` returned by the `getAccessTokenSilently` function. The `decodedToken` returns the permissions that based on those you will do the decision-making from the application level. + ### Refresh tokens don't seem to work. Something has been mixed-up on the configuration of the application by the person/team responsible. They have to make sure that your API settings have `Allow Offline Access` and `Refresh Token` enabled. diff --git a/jest.config.js b/jest.config.js index 8f7edf8b..dd9f2efc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,6 @@ module.exports = { preset: 'ts-jest', + workerIdleMemoryLimit: 0.75, testEnvironment: 'jsdom', testRegex: '(\\.(test|spec))\\.(ts|tsx|js)$', transform: { diff --git a/src/authentication/types.ts b/src/authentication/types.ts index dbe3ab76..ed254078 100644 --- a/src/authentication/types.ts +++ b/src/authentication/types.ts @@ -1,10 +1,47 @@ import { - User, Auth0ClientOptions, GetTokenSilentlyOptions, RedirectLoginOptions, } from '@auth0/auth0-spa-js'; +export type DecodedTokenResponse = { + iss?: string; + sub?: string; + aud?: string[]; + iat?: number; + exp?: number; + azp?: string; + scope?: string; + /** the organization id of the user currently selected **/ + org_id?: string; + /** the permissions defined on the user for more info visit https://orfium.atlassian.net/wiki/spaces/OPS/pages/2554134739/Roles+and+Permissions#Organization-Roles **/ + permissions?: string[]; +}; + +export type User = { + name?: string; + given_name?: string; + family_name?: string; + middle_name?: string; + nickname?: string; + preferred_username?: string; + profile?: string; + picture?: string; + website?: string; + email?: string; + email_verified?: boolean; + gender?: string; + birthdate?: string; + zoneinfo?: string; + locale?: string; + phone_number?: string; + phone_number_verified?: boolean; + address?: string; + updated_at?: string; + sub?: string; + [key: string]: any; +}; + export type AuthenticationContextProps = { isAuthenticated: boolean; isLoading: boolean; @@ -12,7 +49,7 @@ export type AuthenticationContextProps = { logout: () => void; getAccessTokenSilently: ( opts?: GetTokenSilentlyOptions - ) => Promise<{ token: string; decodedToken: Record }>; + ) => Promise<{ token: string; decodedToken: DecodedTokenResponse | Record }>; user: User | undefined; };