@genesislcap/foundation-auth 14.71.1-auth-mf.9 → 14.71.1-auth-mf.10
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.
- package/README.md +118 -10
- package/dist/dts/entity/index.d.ts +0 -1
- package/dist/dts/entity/index.d.ts.map +1 -1
- package/dist/dts/index.d.ts +2 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/logout/index.d.ts +2 -0
- package/dist/dts/logout/index.d.ts.map +1 -0
- package/dist/dts/logout/logout.d.ts +31 -0
- package/dist/dts/logout/logout.d.ts.map +1 -0
- package/dist/dts/machine/machine.d.ts +6 -11
- package/dist/dts/machine/machine.d.ts.map +1 -1
- package/dist/dts/machine/types.d.ts +27 -23
- package/dist/dts/machine/types.d.ts.map +1 -1
- package/dist/dts/main/config.d.ts +11 -9
- package/dist/dts/main/config.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +3 -31
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/mapper/map.d.ts +1 -1
- package/dist/dts/mapper/map.d.ts.map +1 -1
- package/dist/dts/mapper/messageMapper.d.ts.map +1 -1
- package/dist/dts/routes/base.d.ts +9 -17
- package/dist/dts/routes/base.d.ts.map +1 -1
- package/dist/dts/routes/config.d.ts +1 -1
- package/dist/dts/routes/config.d.ts.map +1 -1
- package/dist/dts/routes/forgot-password/forgot-password.d.ts.map +1 -1
- package/dist/dts/routes/login/login.d.ts +4 -8
- package/dist/dts/routes/login/login.d.ts.map +1 -1
- package/dist/dts/routes/login/login.template.d.ts.map +1 -1
- package/dist/dts/routes/logout/logout.d.ts +6 -0
- package/dist/dts/routes/logout/logout.d.ts.map +1 -0
- package/dist/dts/routes/logout/logout.styles.d.ts +2 -0
- package/dist/dts/routes/logout/logout.styles.d.ts.map +1 -0
- package/dist/dts/routes/logout/logout.template.d.ts +3 -0
- package/dist/dts/routes/logout/logout.template.d.ts.map +1 -0
- package/dist/dts/routes/protected/protected.d.ts +2 -0
- package/dist/dts/routes/protected/protected.d.ts.map +1 -1
- package/dist/dts/routes/protected/protected.template.d.ts.map +1 -1
- package/dist/dts/routes/request-account/request-account.d.ts.map +1 -1
- package/dist/dts/routes/request-account/request-account.template.d.ts.map +1 -1
- package/dist/dts/routes/reset-password/reset-password.d.ts.map +1 -1
- package/dist/dts/routes/verify/verify.template.d.ts.map +1 -1
- package/dist/dts/store/auth.d.ts +4 -8
- package/dist/dts/store/auth.d.ts.map +1 -1
- package/dist/dts/user/config.d.ts +29 -0
- package/dist/dts/user/config.d.ts.map +1 -0
- package/dist/dts/user/index.d.ts +3 -0
- package/dist/dts/user/index.d.ts.map +1 -0
- package/dist/dts/{entity → user}/user.d.ts +7 -5
- package/dist/dts/user/user.d.ts.map +1 -0
- package/dist/esm/entity/index.js +0 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/logout/index.js +1 -0
- package/dist/esm/logout/logout.js +31 -0
- package/dist/esm/machine/machine.js +208 -206
- package/dist/esm/machine/types.js +22 -4
- package/dist/esm/main/config.js +14 -6
- package/dist/esm/main/main.js +1 -76
- package/dist/esm/mapper/map.js +1 -1
- package/dist/esm/mapper/messageMapper.js +1 -4
- package/dist/esm/routes/base.js +8 -48
- package/dist/esm/routes/config.js +9 -7
- package/dist/esm/routes/forgot-password/forgot-password.js +0 -4
- package/dist/esm/routes/login/login.js +5 -46
- package/dist/esm/routes/login/login.template.js +0 -11
- package/dist/esm/routes/logout/logout.js +23 -0
- package/dist/esm/routes/logout/logout.styles.js +5 -0
- package/dist/esm/routes/logout/logout.template.js +13 -0
- package/dist/esm/routes/protected/protected.js +7 -0
- package/dist/esm/routes/protected/protected.template.js +6 -0
- package/dist/esm/routes/request-account/request-account.js +1 -5
- package/dist/esm/routes/request-account/request-account.template.js +2 -6
- package/dist/esm/routes/reset-password/reset-password.js +1 -5
- package/dist/esm/routes/verify/verify.js +2 -5
- package/dist/esm/routes/verify/verify.template.js +2 -6
- package/dist/esm/store/auth.js +2 -5
- package/dist/esm/user/config.js +17 -0
- package/dist/esm/user/index.js +2 -0
- package/dist/esm/{entity → user}/user.js +9 -2
- package/dist/foundation-auth.api.json +590 -449
- package/dist/foundation-auth.d.ts +123 -91
- package/docs/api/foundation-auth.auth.md +0 -8
- package/docs/api/foundation-auth.authconfig.md +0 -1
- package/docs/api/foundation-auth.autheventmap.md +2 -3
- package/docs/api/{foundation-auth.authmachinecontext.authdto.md → foundation-auth.authmachinecontext.dto.md} +3 -3
- package/docs/api/{foundation-auth.authmachinecontext.authentity.md → foundation-auth.authmachinecontext.entity.md} +3 -3
- package/docs/api/foundation-auth.authmachinecontext.md +3 -5
- package/docs/api/foundation-auth.authmachinecontext.params.md +2 -0
- package/docs/api/foundation-auth.authmachineevent.md +0 -6
- package/docs/api/foundation-auth.authmachineeventparams.md +2 -2
- package/docs/api/foundation-auth.authstore.md +0 -1
- package/docs/api/foundation-auth.authstore.onlogin.md +2 -2
- package/docs/api/foundation-auth.configure.md +2 -4
- package/docs/api/foundation-auth.defaultauthmachine._constructor_.md +2 -4
- package/docs/api/foundation-auth.defaultauthmachine.captureauthqueryparams.md +15 -0
- package/docs/api/foundation-auth.defaultauthmachine.convertqueryparamstologinparams.md +22 -0
- package/docs/api/foundation-auth.defaultauthmachine.md +4 -2
- package/docs/api/foundation-auth.defaultauthmachine.onidleevents.md +0 -4
- package/docs/api/foundation-auth.defaultauthstore.md +0 -1
- package/docs/api/foundation-auth.defaultlogoututility.md +21 -0
- package/docs/api/foundation-auth.defaultlogoututility.run.md +15 -0
- package/docs/api/foundation-auth.defaultuser.config.md +11 -0
- package/docs/api/foundation-auth.defaultuser.trackpath.md +1 -8
- package/docs/api/foundation-auth.defaultuserconfig.md +13 -0
- package/docs/api/foundation-auth.getsubroutepath.md +25 -0
- package/docs/api/foundation-auth.isloginparams.md +24 -0
- package/docs/api/foundation-auth.isqueryparams.md +24 -0
- package/docs/api/foundation-auth.loginparams.md +1 -3
- package/docs/api/foundation-auth.logoututility.md +24 -0
- package/docs/api/{foundation-auth.auth.logout.md → foundation-auth.logoututility.run.md} +3 -3
- package/docs/api/foundation-auth.md +9 -1
- package/docs/api/foundation-auth.queryparams.md +15 -0
- package/docs/api/foundation-auth.userconfig.md +21 -0
- package/docs/api/foundation-auth.userconfig.trackactionexclusions.md +13 -0
- package/docs/api/foundation-auth.userconfig.trackpathexclusions.md +13 -0
- package/docs/api/foundation-auth.userpathhistory.md +1 -1
- package/docs/api/foundation-auth.userpathhistory.trackpath.md +1 -8
- package/docs/api-report.md +63 -63
- package/package.json +45 -12
- package/dist/dts/entity/user.d.ts.map +0 -1
- package/docs/api/foundation-auth.auth.loginwithcookies.md +0 -15
- package/docs/api/foundation-auth.auth.loginwithcredentials.md +0 -22
- package/docs/api/foundation-auth.authconfig.autoconnect.md +0 -13
- package/docs/api/foundation-auth.authmachinecontext.credentials.md +0 -18
- package/docs/api/foundation-auth.authmachinecontext.mapper.md +0 -13
- package/docs/api/foundation-auth.authstore.onlogindetails.md +0 -22
- package/docs/api/foundation-auth.defaultauthstore.onlogindetails.md +0 -11
package/README.md
CHANGED
|
@@ -1,8 +1,104 @@
|
|
|
1
1
|
# Foundation Auth
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://lerna.js.org/)
|
|
4
|
+
[](https://www.typescriptlang.org/)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
`foundation-auth` provides several exports to promote reuse and extensibility at various levels. These include but are
|
|
7
|
+
not limited to:
|
|
8
|
+
|
|
9
|
+
* `Auth`: The fully featured authentication micro frontend.
|
|
10
|
+
* `User`: The user singleton, which always exists in either an anonymous or authenticated mode.
|
|
11
|
+
* `AuthStore`: An auth based `foundation-store`.
|
|
12
|
+
* `AuthMachine`: An auth based `foundation-state-machine` covering the various auth workflows.
|
|
13
|
+
* `AuthMessageMapper`: The auth message dto to entity mapper.
|
|
14
|
+
* `LogoutUtility`: A logout utility.
|
|
15
|
+
* Various UI components / screens.
|
|
16
|
+
|
|
17
|
+
In most cases, developers simply import both the `User` and `Auth` micro frontend, and use the `configure` export token
|
|
18
|
+
to tailor the micro frontend to their specific needs in their router config. However, developers can also use the
|
|
19
|
+
exports provided to build their own authentication frontends or workflows. A set of pre-defined custom events are used
|
|
20
|
+
to interact with the `AuthStore` and `AuthMachine`, and developers can provide custom implementations of parts of the
|
|
21
|
+
machine's workflow.
|
|
22
|
+
|
|
23
|
+
## Basic setup instructions
|
|
24
|
+
These examples are based on a host application using [FAST](https://www.fast.design/) and the
|
|
25
|
+
[FASTRouter](https://www.npmjs.com/package/@microsoft/fast-router). However, setup in the frontend and router of your
|
|
26
|
+
choice should be quite similar.
|
|
27
|
+
|
|
28
|
+
### Import the user
|
|
29
|
+
```ts
|
|
30
|
+
import { User } from '@genesislcap/foundation-auth/user';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Set up a route to host the micro frontend
|
|
34
|
+
Here we are lazy loading the micro frontend when the route is accessed.
|
|
35
|
+
```ts
|
|
36
|
+
{
|
|
37
|
+
title: 'Login',
|
|
38
|
+
name: 'login',
|
|
39
|
+
path: 'login', // < at what path should the micro frontend be accessed
|
|
40
|
+
element: async () => {
|
|
41
|
+
const { Auth, configure } = await import('@genesislcap/foundation-auth');
|
|
42
|
+
configure({
|
|
43
|
+
omitRoutes: ['request-account'],
|
|
44
|
+
hostPath: 'login', // < important to match the route path
|
|
45
|
+
defaultRedirectUrl: 'my-dashboard',
|
|
46
|
+
logo: myLogo,
|
|
47
|
+
background: myBG,
|
|
48
|
+
});
|
|
49
|
+
return Auth;
|
|
50
|
+
},
|
|
51
|
+
childRouters: true,
|
|
52
|
+
settings: { public: true },
|
|
53
|
+
layout: authLayout,
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Checking the user authentication status during routing
|
|
58
|
+
Here in our `FASTRouter`'s `NavigationContributor`, we check the user status as part of the routing flow.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
this.contributors.push({
|
|
62
|
+
navigate: async (phase) => {
|
|
63
|
+
const settings = phase.route.settings;
|
|
64
|
+
/**
|
|
65
|
+
* Don't block public routes or any routes when authenticated
|
|
66
|
+
*/
|
|
67
|
+
if (settings?.public || this.user.isAuthenticated) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Otherwise route them to login
|
|
72
|
+
*/
|
|
73
|
+
phase.cancel(() => {
|
|
74
|
+
this.user.trackPath();
|
|
75
|
+
Route.name.replace(phase.router, 'login');
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Establishing a Websocket Connection
|
|
82
|
+
Post login you can import the `SOCKET_URL` from auth and connect to the backend.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
import { SOCKET_URL } from '@genesislcap/foundation-auth/env';
|
|
86
|
+
...
|
|
87
|
+
@Connect private connect: Connect,
|
|
88
|
+
...
|
|
89
|
+
this.connect.connect(SOCKET_URL);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## [API Docs](./docs/api/index.md)
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
|
|
97
|
+
|
|
98
|
+
### Licensed components
|
|
99
|
+
Genesis low-code platform
|
|
100
|
+
|
|
101
|
+
# Docs to aid collaboration during development (Will be removed)
|
|
6
102
|
|
|
7
103
|
1. Get VPN up and ensure `public-foundation-hardened1` is running, then run:
|
|
8
104
|
|
|
@@ -12,6 +108,26 @@ npm run dev:withVars
|
|
|
12
108
|
|
|
13
109
|
This will load the .envs. There's work to do in `genx` to load these by default, so we need `lerna` to do it for now.
|
|
14
110
|
|
|
111
|
+
If you're testing as part of an app, there needs to be a .env file in that root, and it should contain the following variables:
|
|
112
|
+
|
|
113
|
+
```dotenv
|
|
114
|
+
# There should be nothing sensetive here!
|
|
115
|
+
|
|
116
|
+
# HTTP
|
|
117
|
+
GENX_LOGIN_URL=https://public-foundation-hardened1/sm/event-login-auth
|
|
118
|
+
GENX_LOGIN_REFRESH_URL=https://public-foundation-hardened1/sm/event-login-auth
|
|
119
|
+
GENX_LOGIN_DETAILS_URL=https://public-foundation-hardened1/sm/event-login-details
|
|
120
|
+
GENX_LOGOUT_URL=https://public-foundation-hardened1/sm/event-logout
|
|
121
|
+
GENX_CHANGE_PASSWORD_URL=https://public-foundation-hardened1/sm/event-change-user-password
|
|
122
|
+
GENX_FORGOT_PASSWORD_URL=https://public-foundation-hardened1/sm/event-self-service-password-reset
|
|
123
|
+
GENX_RESET_PASSWORD_URL=https://public-foundation-hardened1/sm/event-password-reset-action
|
|
124
|
+
|
|
125
|
+
# Socket
|
|
126
|
+
GENX_SOCKET_URL=wss://public-foundation-hardened1/gwf/
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
You will see warnings in the console if any are unset.
|
|
130
|
+
|
|
15
131
|
2. Autofill the form with JohnDoe and the usual password.
|
|
16
132
|
|
|
17
133
|
3. Press Login button or use the shortcut links on the login screen's footer to
|
|
@@ -23,11 +139,3 @@ trigger machine events to test various, ie. when you already have a cookie, or l
|
|
|
23
139
|
|
|
24
140
|
6. Other gotchas like the previous point exist.
|
|
25
141
|
|
|
26
|
-
[API](./docs/api/index.md)
|
|
27
|
-
|
|
28
|
-
## License
|
|
29
|
-
|
|
30
|
-
Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
|
|
31
|
-
|
|
32
|
-
### Licensed components
|
|
33
|
-
Genesis low-code platform
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './env';
|
|
2
2
|
export * from './dto';
|
|
3
3
|
export * from './entity';
|
|
4
|
+
export * from './logout';
|
|
4
5
|
export * from './machine';
|
|
5
6
|
export * from './main';
|
|
6
7
|
export * from './mapper';
|
|
7
8
|
export * from './routes';
|
|
8
9
|
export * from './store';
|
|
10
|
+
export * from './user';
|
|
9
11
|
export * from './utils';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/logout/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LogoutUtility interface.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* A utility to execute a logout flow via a route change.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface LogoutUtility {
|
|
10
|
+
run(): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Default LogoutUtility.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare class DefaultLogoutUtility implements LogoutUtility {
|
|
18
|
+
private config;
|
|
19
|
+
private user;
|
|
20
|
+
run(): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* LogoutUtility DI key.
|
|
24
|
+
*
|
|
25
|
+
* @privateRemarks
|
|
26
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare const LogoutUtility: import("@microsoft/fast-foundation").InterfaceSymbol<LogoutUtility>;
|
|
31
|
+
//# sourceMappingURL=logout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/logout/logout.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,IAAI,IAAI,CAAC;CACb;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,aAAa;IAC5C,OAAO,CAAC,MAAM,CAAa;IACjC,OAAO,CAAC,IAAI,CAAO;IACzB,GAAG;CAKJ;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,qEAEzB,CAAC"}
|
|
@@ -3,11 +3,10 @@ import type { Message } from '@genesislcap/foundation-comms';
|
|
|
3
3
|
import { AbstractMachine, FetchMachine, FetchMachineEvent, Machine } from '@genesislcap/foundation-state-machine';
|
|
4
4
|
import { UUID } from '@genesislcap/foundation-utils';
|
|
5
5
|
import type { InterpreterOptions } from 'xstate';
|
|
6
|
-
import { User } from '../entity';
|
|
7
6
|
import { AuthConfig } from '../main/config';
|
|
8
|
-
import { LoginMapper, LogoutMapper } from '../mapper';
|
|
9
|
-
import type { AuthMachineContext, AuthMachineEvent } from './types';
|
|
10
7
|
import { AuthMessageMapper } from '../mapper/messageMapper';
|
|
8
|
+
import { User } from '../user';
|
|
9
|
+
import type { AuthMachineContext, AuthMachineEvent, LoginParams, QueryParams } from './types';
|
|
11
10
|
/**
|
|
12
11
|
* AuthMachine interface.
|
|
13
12
|
* @public
|
|
@@ -23,28 +22,24 @@ export declare class DefaultAuthMachine extends AbstractMachine<AuthMachineConte
|
|
|
23
22
|
private connect;
|
|
24
23
|
private fetchMachine;
|
|
25
24
|
private messageBuilder;
|
|
26
|
-
private
|
|
25
|
+
private cm;
|
|
27
26
|
private uuid;
|
|
28
|
-
private loginMapper;
|
|
29
|
-
private logoutMapper;
|
|
30
27
|
private messageMapper;
|
|
31
28
|
private config;
|
|
32
|
-
constructor(user: User, connect: Connect, fetchMachine: FetchMachine, messageBuilder: MessageBuilder,
|
|
29
|
+
constructor(user: User, connect: Connect, fetchMachine: FetchMachine, messageBuilder: MessageBuilder, cm: CredentialManager, uuid: UUID, messageMapper: AuthMessageMapper, config: AuthConfig);
|
|
33
30
|
start(options?: InterpreterOptions<typeof this.machine>): void;
|
|
34
31
|
/**
|
|
35
32
|
* AuthMachine is a singleton.
|
|
36
33
|
*/
|
|
37
34
|
getFromContainer(): this;
|
|
35
|
+
protected captureAuthQueryParams(): QueryParams;
|
|
36
|
+
protected convertQueryParamsToLoginParams(params: QueryParams): LoginParams;
|
|
38
37
|
protected createFetchMachineEvent(url: string, msg?: Message): FetchMachineEvent;
|
|
39
38
|
protected onIdleEvents: () => {
|
|
40
39
|
login: {
|
|
41
40
|
actions: string[];
|
|
42
41
|
target: string;
|
|
43
42
|
};
|
|
44
|
-
"login-details": {
|
|
45
|
-
actions: string[];
|
|
46
|
-
target: string;
|
|
47
|
-
};
|
|
48
43
|
"forgot-password": {
|
|
49
44
|
actions: string[];
|
|
50
45
|
target: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../src/machine/machine.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../src/machine/machine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,iBAAiB,EACjB,cAAc,EACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EACL,eAAe,EAEf,YAAY,EACZ,iBAAiB,EAMjB,OAAO,EAER,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAWjD,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAU7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAGhB,WAAW,EACX,WAAW,EAEZ,MAAM,SAAS,CAAC;AAGjB;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;CAAG;AAErF;;;GAGG;AACH,qBAAa,kBACX,SAAQ,eAAe,CAAC,kBAAkB,EAAE,gBAAgB,CAC5D,YAAW,WAAW;IAGd,OAAO,CAAC,IAAI;IACT,OAAO,CAAC,OAAO;IACV,OAAO,CAAC,YAAY;IAClB,OAAO,CAAC,cAAc;IACnB,OAAO,CAAC,EAAE;IACvB,OAAO,CAAC,IAAI;IACC,OAAO,CAAC,aAAa;IAC5B,OAAO,CAAC,MAAM;gBAPZ,IAAI,EAAE,IAAI,EACP,OAAO,EAAE,OAAO,EACX,YAAY,EAAE,YAAY,EACxB,cAAc,EAAE,cAAc,EAC3B,EAAE,EAAE,iBAAiB,EAClC,IAAI,EAAE,IAAI,EACG,aAAa,EAAE,iBAAiB,EACvC,MAAM,EAAE,UAAU;IAimBxC,KAAK,CACH,OAAO,GAAE,kBAAkB,CAAC,OAAO,IAAI,CAAC,OAAO,CAM9C;IAKH;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAIxB,SAAS,CAAC,sBAAsB,IAAI,WAAW;IAQ/C,SAAS,CAAC,+BAA+B,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW;IAqB3E,SAAS,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,OAAY,GAAG,iBAAiB;IAgBpF,SAAS,CAAC,YAAY;;;;;;;;;;;;;;;;;MAiBnB;IAEH,SAAS,CAAC,SAAS;;;MAGhB;CACJ;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,mEAA0E,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { AuthInfo } from '@genesislcap/foundation-comms';
|
|
2
2
|
import type { MachineContext } from '@genesislcap/foundation-state-machine';
|
|
3
3
|
import type { DoneInvokeEvent, ErrorEvent } from 'xstate';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
4
|
+
import type { AuthDTO, AuthEntity } from '../mapper';
|
|
5
|
+
import type { User } from '../user';
|
|
6
6
|
/**
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export type LoginParams =
|
|
10
|
-
credentials: AuthInfo;
|
|
11
|
-
};
|
|
9
|
+
export type LoginParams = AuthInfo;
|
|
12
10
|
/**
|
|
13
11
|
* @public
|
|
14
12
|
*/
|
|
@@ -35,11 +33,18 @@ export type ResetPasswordParams = {
|
|
|
35
33
|
newPassword: string;
|
|
36
34
|
requester?: string;
|
|
37
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export type QueryParams = {
|
|
40
|
+
SSO_TOKEN?: string;
|
|
41
|
+
MFA_CODE?: string;
|
|
42
|
+
};
|
|
38
43
|
/**
|
|
39
44
|
* AuthMachineEventParams type.
|
|
40
45
|
* @public
|
|
41
46
|
*/
|
|
42
|
-
export type AuthMachineEventParams = LoginParams | ForgotPasswordParams | ChangePasswordParams | ResetPasswordParams;
|
|
47
|
+
export type AuthMachineEventParams = LoginParams | ForgotPasswordParams | ChangePasswordParams | ResetPasswordParams | QueryParams;
|
|
43
48
|
/**
|
|
44
49
|
* AuthMachineContext interface.
|
|
45
50
|
* @remarks
|
|
@@ -47,25 +52,18 @@ export type AuthMachineEventParams = LoginParams | ForgotPasswordParams | Change
|
|
|
47
52
|
* @public
|
|
48
53
|
*/
|
|
49
54
|
export interface AuthMachineContext extends MachineContext {
|
|
50
|
-
params?: AuthMachineEventParams;
|
|
51
55
|
/**
|
|
52
|
-
*
|
|
53
|
-
* @remarks
|
|
54
|
-
* Optional as it's possible to reauthenticate silently.
|
|
56
|
+
* Authentication event params.
|
|
55
57
|
*/
|
|
56
|
-
|
|
58
|
+
params?: AuthMachineEventParams;
|
|
57
59
|
/**
|
|
58
60
|
* The login/login DTO from the fetch machine.
|
|
59
61
|
*/
|
|
60
|
-
|
|
62
|
+
dto: AuthDTO;
|
|
61
63
|
/**
|
|
62
64
|
* The login/login Entity mapped from the DTO.
|
|
63
65
|
*/
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* The mapper for the action being taken.
|
|
67
|
-
*/
|
|
68
|
-
mapper: Mapper<AuthDTO, AuthEntity>;
|
|
66
|
+
entity: AuthEntity;
|
|
69
67
|
/**
|
|
70
68
|
* The user, either authenticated or anonymous.
|
|
71
69
|
*/
|
|
@@ -82,12 +80,6 @@ export type AuthMachineEvent = {
|
|
|
82
80
|
params: LoginParams;
|
|
83
81
|
} | {
|
|
84
82
|
type: 'logout';
|
|
85
|
-
} | {
|
|
86
|
-
type: 'openSocket';
|
|
87
|
-
} | {
|
|
88
|
-
type: 'closeSocket';
|
|
89
|
-
} | {
|
|
90
|
-
type: 'login-details';
|
|
91
83
|
} | {
|
|
92
84
|
type: 'change-password';
|
|
93
85
|
params: ChangePasswordParams;
|
|
@@ -112,4 +104,16 @@ export type AuthMachineEventMap = {
|
|
|
112
104
|
* @public
|
|
113
105
|
*/
|
|
114
106
|
export declare const defaultAuthMachineContext: Partial<AuthMachineContext>;
|
|
107
|
+
/**
|
|
108
|
+
* isLoginParams.
|
|
109
|
+
* @param params - Potential LoginParams.
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
export declare function isLoginParams(params: AuthMachineEventParams): params is LoginParams;
|
|
113
|
+
/**
|
|
114
|
+
* isQueryParams.
|
|
115
|
+
* @param params - Potential QueryParams.
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
118
|
+
export declare function isQueryParams(params: AuthMachineEventParams): params is QueryParams;
|
|
115
119
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/machine/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/machine/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,O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d,MAAM,EAAE,WAAW,CAAC;CACrB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;CAChB,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,oBAAoB,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,oBAAoB,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,GACD,eAAe,CAAC,OAAO,CAAC,GACxB,UAAU,CAAC,OAAO,CAAC,CAAC;AAExB;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,oBAAoB,EAAE,gBAAgB,CAAC;CACxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAC,kBAAkB,CAKjE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,IAAI,WAAW,CAGnF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,IAAI,WAAW,CAGnF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ElementStyles } from '@microsoft/fast-element';
|
|
2
|
-
import { Container } from '@microsoft/fast-foundation';
|
|
3
2
|
/**
|
|
4
3
|
* @public
|
|
5
4
|
*/
|
|
@@ -54,6 +53,15 @@ export type Routes = (typeof Routes)[keyof typeof Routes];
|
|
|
54
53
|
* I've just put this util in for now given there's some app level direction code in place which needs review.
|
|
55
54
|
*/
|
|
56
55
|
export declare function isMFRoute(pathname?: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* A utility to get a sub route path taking the host path into account.
|
|
58
|
+
*
|
|
59
|
+
* @param routeName - The route name.
|
|
60
|
+
* @param hostPath - The host path.
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export declare function getSubRoutePath(routeName: Routes | string, hostPath?: string): string;
|
|
57
65
|
/**
|
|
58
66
|
* @public
|
|
59
67
|
* Could be expanded to allow field ViewTemplates.
|
|
@@ -116,10 +124,6 @@ export type SSOConfig = {
|
|
|
116
124
|
* @public
|
|
117
125
|
*/
|
|
118
126
|
export interface AuthConfig {
|
|
119
|
-
/**
|
|
120
|
-
* Connect automatically or require user to click a connect button.
|
|
121
|
-
*/
|
|
122
|
-
autoConnect: boolean;
|
|
123
127
|
/**
|
|
124
128
|
* Login automatically or require user to click a login button after a connection is established.
|
|
125
129
|
*
|
|
@@ -260,7 +264,6 @@ export declare const AuthConfig: import("@microsoft/fast-foundation").InterfaceS
|
|
|
260
264
|
* @remarks
|
|
261
265
|
* This is primarily for general settings, rather than re-defining the element, static templating / style changes.
|
|
262
266
|
*
|
|
263
|
-
* @param container - DI container.
|
|
264
267
|
* @param config - A partial AuthConfig.
|
|
265
268
|
*
|
|
266
269
|
* @example Configuring auth on lazy load
|
|
@@ -270,8 +273,7 @@ export declare const AuthConfig: import("@microsoft/fast-foundation").InterfaceS
|
|
|
270
273
|
* title: 'Login',
|
|
271
274
|
* element: async () => {
|
|
272
275
|
* const { configure, define, defaultAuthConfig } = await import('@genesislcap/foundation-auth');
|
|
273
|
-
* configure(
|
|
274
|
-
* autoConnect: true,
|
|
276
|
+
* configure({
|
|
275
277
|
* omitRoutes: ['request-account'],
|
|
276
278
|
* fields: {
|
|
277
279
|
* ...defaultAuthConfig.fields,
|
|
@@ -298,5 +300,5 @@ export declare const AuthConfig: import("@microsoft/fast-foundation").InterfaceS
|
|
|
298
300
|
* @privateRemarks
|
|
299
301
|
* We can tailor the spreading logic after we put it to use. Keeping it simple for now.
|
|
300
302
|
*/
|
|
301
|
-
export declare function configure(
|
|
303
|
+
export declare function configure(config: Partial<AuthConfig>): void;
|
|
302
304
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/main/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAO,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/main/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAO,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAM7D;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAuB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,QAAe,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,eAAe,QAAmB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,cAAc,QAAW,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAa,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,OAAO,QAAgB,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,OAAO,QAAW,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;CAQT,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC;AAE1D;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,QAAQ,GAAE,MAA0B,GAAG,OAAO,CAKvE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,GAAE,MAAW,GAAG,MAAM,CAEzF;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM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,UAAU,kEAAuE,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,QAOpD"}
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CredentialManager, Session } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { Container } from '@microsoft/fast-foundation';
|
|
3
3
|
import { MainRouterConfig } from '../routes';
|
|
4
4
|
import { AuthEventMap, AuthStore } from '../store';
|
|
5
5
|
declare const Auth_base: abstract new (...args: any[]) => {
|
|
6
|
-
$emit<K extends "store-connected" | "store-disconnected" | "store-ready" | "auth-machine-event" | "auth-login" | "auth-
|
|
6
|
+
$emit<K extends "store-connected" | "store-disconnected" | "store-ready" | "auth-machine-event" | "auth-login" | "auth-logout" | "auth-change-password" | "auth-forgot-password" | "auth-reset-password">(...args: AuthEventMap[K] extends void ? [type: K, options?: import("@genesislcap/foundation-events").EmitOptions] : [type: K, detail: AuthEventMap[K], options?: import("@genesislcap/foundation-events").EmitOptions]): import("@genesislcap/foundation-events").EmitReturn;
|
|
7
7
|
accessKey: string;
|
|
8
8
|
readonly accessKeyLabel: string;
|
|
9
9
|
autocapitalize: string;
|
|
@@ -46,9 +46,7 @@ declare const Auth_base: abstract new (...args: any[]) => {
|
|
|
46
46
|
readonly prefix: string;
|
|
47
47
|
readonly scrollHeight: number;
|
|
48
48
|
scrollLeft: number;
|
|
49
|
-
scrollTop: number;
|
|
50
|
-
* Send event to indicate some async work is happening. Will be picked up by overlay micro frontend.
|
|
51
|
-
*/
|
|
49
|
+
scrollTop: number;
|
|
52
50
|
readonly scrollWidth: number;
|
|
53
51
|
readonly shadowRoot: ShadowRoot;
|
|
54
52
|
slot: string;
|
|
@@ -366,29 +364,6 @@ export declare class Auth extends Auth_base {
|
|
|
366
364
|
* @internal
|
|
367
365
|
*/
|
|
368
366
|
disconnectedCallback(): void;
|
|
369
|
-
/**
|
|
370
|
-
* Used to forward the user onto a logged-in session during an SSO and MFA journeys
|
|
371
|
-
*
|
|
372
|
-
* @remarks
|
|
373
|
-
*
|
|
374
|
-
* Called when loading the login page via the connectedCallback() method.
|
|
375
|
-
* During normal flows there will be no SSO tokens set and hence this function
|
|
376
|
-
* will quit execution.
|
|
377
|
-
* During an SSO journey the SSO provider will set the SSO token as a URLSearchParams
|
|
378
|
-
* parameter and redirect back to us. In this case we will take this and forward the
|
|
379
|
-
* user on, with their logged in session.
|
|
380
|
-
*
|
|
381
|
-
* There are two paths the user can take here - if they are in a popup
|
|
382
|
-
* (window.opener exists) then we need to set the session and get the parent window
|
|
383
|
-
* (the one which the user wants their session on) to refresh, and close the popup.
|
|
384
|
-
*
|
|
385
|
-
* Or if they are not in a popup then we simply set the ssoToken in the session.
|
|
386
|
-
* When this component is loaded with the ssoToken then it will redirect the
|
|
387
|
-
* user to their app (the `defaultRedirectUrl`).
|
|
388
|
-
*
|
|
389
|
-
* @internal
|
|
390
|
-
*/
|
|
391
|
-
actionQueryParams(): void;
|
|
392
367
|
/**
|
|
393
368
|
* Called from the connectedCallback
|
|
394
369
|
* @internal
|
|
@@ -410,9 +385,6 @@ export declare class Auth extends Auth_base {
|
|
|
410
385
|
* @internal
|
|
411
386
|
*/
|
|
412
387
|
protected readyStore(): void;
|
|
413
|
-
loginWithCredentials(credentials: AuthInfo): void;
|
|
414
|
-
loginWithCookies(): void;
|
|
415
|
-
logout(): void;
|
|
416
388
|
}
|
|
417
389
|
/**
|
|
418
390
|
* @beta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,OAAO,EACR,MAA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,wBAAwB;CAG/B"}
|
package/dist/dts/mapper/map.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/mapper/map.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/mapper/map.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,aAAa,CAC5B,OAAO,SAAS,mBAAmB,EACnC,CAAC,SAAS,MAAM,OAAO,GAAG,MAAM,OAAO,CACvC,SAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC7E;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACvC;AAED;;GAEG;AACH,qBAAa,oBAAoB,CAC/B,OAAO,SAAS,mBAAmB,EACnC,CAAC,SAAS,MAAM,OAAO,GAAG,MAAM,OAAO,CACvC,YAAW,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IAExB,OAAO,CAAC,GAAG,CAA4B;IAEnD,iCAAiC;IACjC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;IAIrC;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS;IAInC;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAIpB;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAQvB;;;OAGG;IACH,KAAK;IAIL;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,+GAGwC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageMapper.d.ts","sourceRoot":"","sources":["../../../src/mapper/messageMapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"messageMapper.d.ts","sourceRoot":"","sources":["../../../src/mapper/messageMapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa,CAAC,uBAAuB,CAAC;CAAG;AAEpF;;;GAGG;AACH,qBAAa,wBACX,SAAQ,oBAAoB,CAAC,uBAAuB,CACpD,YAAW,iBAAiB;IAGb,SAAS,CAAC,WAAW,EAAE,WAAW;IACjC,SAAS,CAAC,YAAY,EAAE,YAAY;gBAD3B,WAAW,EAAE,WAAW,EACvB,YAAY,EAAE,YAAY;CAUrD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,yEAE7B,CAAC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Connect, CredentialManager } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { Binding } from '@microsoft/fast-element';
|
|
3
3
|
import { Container } from '@microsoft/fast-foundation';
|
|
4
|
-
import { NavigationPhase } from '@microsoft/fast-router';
|
|
5
|
-
import { User } from '../entity';
|
|
6
4
|
import { AuthConfig, Routes } from '../main/config';
|
|
7
5
|
import { AuthEventMap, AuthFormEntryEventMap, AuthStore } from '../store';
|
|
8
|
-
import {
|
|
6
|
+
import { User } from '../user';
|
|
9
7
|
type EventMap = AuthEventMap & AuthFormEntryEventMap & {};
|
|
10
8
|
/**
|
|
11
9
|
* @internal
|
|
@@ -15,10 +13,6 @@ export declare const inputEmit: <K extends import("@genesislcap/foundation-event
|
|
|
15
13
|
* @internal
|
|
16
14
|
*/
|
|
17
15
|
export declare const selectEmit: <K extends import("@genesislcap/foundation-events").KeysMatching<EventMap, string>>(type: K, options?: import("@genesislcap/foundation-events").EmitOptions) => Binding<any, any, any>;
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export declare const defaultOnBackMS = 3000;
|
|
22
16
|
/**
|
|
23
17
|
* @internal
|
|
24
18
|
*/
|
|
@@ -26,7 +20,7 @@ export type ConfigHost = {
|
|
|
26
20
|
config: AuthConfig;
|
|
27
21
|
};
|
|
28
22
|
declare const ConfigHostElement_base: abstract new (...args: any[]) => {
|
|
29
|
-
$emit<K extends "auth-autofill-form" | "auth-organisation-changed" | "auth-username-changed" | "auth-email-changed" | "auth-password-changed" | "auth-password2-changed" | "auth-showPasswords-changed" | "store-connected" | "store-disconnected" | "store-ready" | "auth-machine-event" | "auth-login" | "auth-
|
|
23
|
+
$emit<K extends "auth-autofill-form" | "auth-organisation-changed" | "auth-username-changed" | "auth-email-changed" | "auth-password-changed" | "auth-password2-changed" | "auth-showPasswords-changed" | "store-connected" | "store-disconnected" | "store-ready" | "auth-machine-event" | "auth-login" | "auth-logout" | "auth-change-password" | "auth-forgot-password" | "auth-reset-password">(...args: EventMap[K] extends void ? [type: K, options?: import("@genesislcap/foundation-events").EmitOptions] : [type: K, detail: EventMap[K], options?: import("@genesislcap/foundation-events").EmitOptions]): import("@genesislcap/foundation-events").EmitReturn;
|
|
30
24
|
accessKey: string;
|
|
31
25
|
readonly accessKeyLabel: string;
|
|
32
26
|
autocapitalize: string;
|
|
@@ -62,6 +56,9 @@ declare const ConfigHostElement_base: abstract new (...args: any[]) => {
|
|
|
62
56
|
readonly localName: string;
|
|
63
57
|
readonly namespaceURI: string;
|
|
64
58
|
onfullscreenchange: (this: Element, ev: Event) => any;
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
65
62
|
onfullscreenerror: (this: Element, ev: Event) => any;
|
|
66
63
|
outerHTML: string;
|
|
67
64
|
readonly ownerDocument: Document;
|
|
@@ -121,6 +118,9 @@ declare const ConfigHostElement_base: abstract new (...args: any[]) => {
|
|
|
121
118
|
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
122
119
|
webkitMatchesSelector(selectors: string): boolean;
|
|
123
120
|
readonly baseURI: string;
|
|
121
|
+
/**
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
124
|
readonly childNodes: NodeListOf<ChildNode>;
|
|
125
125
|
readonly firstChild: ChildNode;
|
|
126
126
|
readonly isConnected: boolean;
|
|
@@ -357,27 +357,19 @@ export declare class ConfigHostElement extends ConfigHostElement_base implements
|
|
|
357
357
|
export declare class BaseRoute extends ConfigHostElement {
|
|
358
358
|
store: AuthStore;
|
|
359
359
|
user: User;
|
|
360
|
-
auth: Auth;
|
|
361
360
|
connect: Connect;
|
|
362
|
-
session: Session;
|
|
363
|
-
messageBuilder: MessageBuilder;
|
|
364
361
|
credentialManager: CredentialManager;
|
|
365
362
|
/**
|
|
366
363
|
* TODO: Replace with machine
|
|
367
364
|
*/
|
|
368
365
|
message: string;
|
|
369
366
|
hasErrors: boolean;
|
|
370
|
-
protected navigationPhase: NavigationPhase<Settings>;
|
|
371
367
|
connectedCallback(): void;
|
|
372
|
-
enter(phase: NavigationPhase<Settings>): void;
|
|
373
|
-
onSubmit(): Promise<void>;
|
|
374
368
|
setError(message: string): void;
|
|
375
369
|
clearError(): void;
|
|
376
370
|
getSubRoutePath(routeName: Routes | string): string;
|
|
377
371
|
onBack: () => void;
|
|
378
372
|
onNavigate: (path: string) => void;
|
|
379
|
-
queueOnBack(delay?: number): void;
|
|
380
|
-
sendMessage<T = any>(message: Message<T>, successFeedback?: string, successCallback?: (result: any) => void): Promise<void>;
|
|
381
373
|
attemptAutofill(): void;
|
|
382
374
|
}
|
|
383
375
|
/**
|