Skip to content

Commit

Permalink
docs: API docs for login PTL-1538 (#1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonZur authored Nov 27, 2024
1 parent 4423559 commit 0c3382a
Show file tree
Hide file tree
Showing 65 changed files with 1,569 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
className: 'hidden'
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [configure](./foundation-login.configure.md)

## configure() function

> Warning: This API is now obsolete.
>
> - Please use foundation-auth instead.
>
Configure the login micro frontend settings.

**Signature:**

```typescript
export declare function configure(container: Container, config: Partial<LoginConfig>): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| container | Container | DI container. |
| config | Partial&lt;[LoginConfig](./foundation-login.loginconfig.md)&gt; | A partial LoginConfig. |

**Returns:**

void

## Remarks

This is primarily for general settings, rather than re-defining the element, static templating / style changes.

## Example

Configuring login on lazy load

```ts
name: 'login',
path: 'login',
title: 'Login',
element: async () => {
const { configure, define, defaultLoginConfig } = await import('@genesislcap/foundation-login');
configure(this.container, {
autoConnect: true,
omitRoutes: ['request-account'],
fields: {
...defaultLoginConfig.fields,
organisation: {
label: 'CompID',
},
},
hostPath: 'login',
defaultRedirectUrl: 'dashboard',
logo: loginLogo,
background: loginBG,
});
// You can import and return `Login` directly here or re-define it completely via `define`.
return define({
name: `nexus-login`,
});
},
layout: loginLayout,
settings: { public: true },
childRouters: true,
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [defaultApiHost](./foundation-login.defaultapihost.md)

## defaultApiHost variable


**Signature:**

```typescript
defaultApiHost: string
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [defaultLoginConfig](./foundation-login.defaultloginconfig.md)

## defaultLoginConfig variable

Default LoginConfig DI implementation.

**Signature:**

```typescript
defaultLoginConfig: LoginConfig
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [defaultOrganisation](./foundation-login.defaultorganisation.md)

## defaultOrganisation variable


**Signature:**

```typescript
defaultOrganisation: string
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [defaultPassword](./foundation-login.defaultpassword.md)

## defaultPassword variable


**Signature:**

```typescript
defaultPassword: string
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [defaultSocketExt](./foundation-login.defaultsocketext.md)

## defaultSocketExt variable


**Signature:**

```typescript
defaultSocketExt: string
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [defaultTemplateOptions](./foundation-login.defaulttemplateoptions.md)

## defaultTemplateOptions variable

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
The default template options this MF has been created with.

**Signature:**

```typescript
defaultTemplateOptions: TemplateOptions
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [defaultUser](./foundation-login.defaultuser.md)

## defaultUser variable


**Signature:**

```typescript
defaultUser: string
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [define](./foundation-login.define.md)

## define variable

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Re-define the login micro frontend.

**Signature:**

```typescript
define: import("@genesislcap/foundation-ui").DefineFunction<typeof Login>
```

## Example


```ts
import { define, styles, template, defaultTemplateOptions } from '@genesislcap/foundation-login';
const customTemplateOptions = {
...defaultTemplateOptions,
...customOptions,
}
export const AppLogin = define({
name: `nexus-login`,
template: template(customTemplateOptions),
styles: css`
${styles(customTemplateOptions)}
some-element {
background-color: #ff00b4;
}
`,
});
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [definition](./foundation-login.definition.md)

## definition variable

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
**Signature:**

```typescript
definition: PartialFASTElementDefinition
```

## Remarks

This is the main definition of this micro frontend which is exposed for user reconfiguration.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [fetchIDPs](./foundation-login.fetchidps.md)

## fetchIDPs variable

Request SSO identity provider list

**Signature:**

```typescript
fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [FieldConfig](./foundation-login.fieldconfig.md)

## FieldConfig type

Could be expanded to allow field ViewTemplates.

**Signature:**

```typescript
export type FieldConfig = {
label: string;
value?: any;
required?: boolean;
pattern?: string;
title?: string;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [FieldConfigMap](./foundation-login.fieldconfigmap.md)

## FieldConfigMap type


**Signature:**

```typescript
export type FieldConfigMap = {
organisation: FieldConfig | null;
username: FieldConfig;
email: FieldConfig;
password: FieldConfig;
};
```
**References:** [FieldConfig](./foundation-login.fieldconfig.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [getSSOLoginURL](./foundation-login.getssologinurl.md)

## getSSOLoginURL variable

Get SSO identity provider login URL

**Signature:**

```typescript
getSSOLoginURL: (idp: any, path?: string, host?: string) => string
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [hostEnv](./foundation-login.hostenv.md)

## hostEnv variable


**Signature:**

```typescript
hostEnv: string
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [hostUrl](./foundation-login.hosturl.md)

## hostUrl variable


**Signature:**

```typescript
hostUrl: string
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
format: md
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@genesislcap/foundation-login](./foundation-login.md) &gt; [IDP](./foundation-login.idp.md) &gt; [id](./foundation-login.idp.id.md)

## IDP.id property

**Signature:**

```typescript
id: string;
```
Loading

0 comments on commit 0c3382a

Please sign in to comment.