@genesislcap/foundation-login 9.0.1-alpha-b5c5eb7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/README.md +160 -0
  2. package/dist/1.0.0.remoteEntry.js +1 -0
  3. package/dist/15.15.b20930426d82ddb7bd44.js +1322 -0
  4. package/dist/15.1f4ec0deba9aca7499d56c621e06b130.js.map +1 -0
  5. package/dist/170.170.f64459527c9480c31e74.js +726 -0
  6. package/dist/170.a9086b342b886f13162e76944c6232ea.js.map +1 -0
  7. package/dist/176.176.bfbfc60ffad852c406c4.js +2 -0
  8. package/dist/176.7ce7d4e386b9ebd99f2a121d6364c1ad.js.map +1 -0
  9. package/dist/185.185.c56719990d52bcca8549.js +2 -0
  10. package/dist/185.d623d7c2df70c9d665343444e7c1fa6c.js.map +1 -0
  11. package/dist/338.338.e399ff6c11eb8175de4c.js +2 -0
  12. package/dist/338.4f68feefeaca1bf1dbc7ba12af2e84aa.js.map +1 -0
  13. package/dist/397.397.22e0364e0ff35fdfe9a0.js +3 -0
  14. package/dist/397.397.22e0364e0ff35fdfe9a0.js.LICENSE.txt +1 -0
  15. package/dist/397.629a215804364ccc7763bc046dbea3d5.js.map +1 -0
  16. package/dist/419.419.00fda3874a096d8457d8.js +2136 -0
  17. package/dist/419.b6fb3444f7d56877c3a81cba8eaca942.js.map +1 -0
  18. package/dist/453.3c9a25d2af3ccf8232fdd1dfc5244b3d.js.map +1 -0
  19. package/dist/453.453.14247e88aa4df78dca2c.js +2 -0
  20. package/dist/726.4c7419d8edb8ba5e67699f4820c8c461.js.map +1 -0
  21. package/dist/726.726.e09fed9a1e3b529acd46.js +3 -0
  22. package/dist/726.726.e09fed9a1e3b529acd46.js.LICENSE.txt +4 -0
  23. package/dist/741.741.d84fc7e9236cae1acc99.js +3 -0
  24. package/dist/741.741.d84fc7e9236cae1acc99.js.LICENSE.txt +4 -0
  25. package/dist/741.a3dfed45252169e53ee396a8b76cea67.js.map +1 -0
  26. package/dist/b634d7e1f2324faf1230.svg +10 -0
  27. package/dist/c0bd2c45d93ce443d624.jpg +0 -0
  28. package/dist/dashboard.json +1 -0
  29. package/dist/dts/components/components.d.ts +5 -0
  30. package/dist/dts/components/components.d.ts.map +1 -0
  31. package/dist/dts/components/index.d.ts +2 -0
  32. package/dist/dts/components/index.d.ts.map +1 -0
  33. package/dist/dts/index.d.ts +3 -0
  34. package/dist/dts/index.d.ts.map +1 -0
  35. package/dist/dts/index.federated.d.ts +1 -0
  36. package/dist/dts/index.federated.d.ts.map +1 -0
  37. package/dist/dts/layouts/default.d.ts +3 -0
  38. package/dist/dts/layouts/default.d.ts.map +1 -0
  39. package/dist/dts/layouts/index.d.ts +2 -0
  40. package/dist/dts/layouts/index.d.ts.map +1 -0
  41. package/dist/dts/main/config.d.ts +261 -0
  42. package/dist/dts/main/config.d.ts.map +1 -0
  43. package/dist/dts/main/define.d.ts +29 -0
  44. package/dist/dts/main/define.d.ts.map +1 -0
  45. package/dist/dts/main/index.d.ts +7 -0
  46. package/dist/dts/main/index.d.ts.map +1 -0
  47. package/dist/dts/main/main.d.ts +179 -0
  48. package/dist/dts/main/main.d.ts.map +1 -0
  49. package/dist/dts/main/main.definition.d.ts +48 -0
  50. package/dist/dts/main/main.definition.d.ts.map +1 -0
  51. package/dist/dts/main/main.styles.d.ts +13 -0
  52. package/dist/dts/main/main.styles.d.ts.map +1 -0
  53. package/dist/dts/main/main.template.d.ts +7 -0
  54. package/dist/dts/main/main.template.d.ts.map +1 -0
  55. package/dist/dts/routes/base.d.ts +127 -0
  56. package/dist/dts/routes/base.d.ts.map +1 -0
  57. package/dist/dts/routes/config.d.ts +27 -0
  58. package/dist/dts/routes/config.d.ts.map +1 -0
  59. package/dist/dts/routes/forgot-password/forgot-password.d.ts +6 -0
  60. package/dist/dts/routes/forgot-password/forgot-password.d.ts.map +1 -0
  61. package/dist/dts/routes/forgot-password/forgot-password.template.d.ts +3 -0
  62. package/dist/dts/routes/forgot-password/forgot-password.template.d.ts.map +1 -0
  63. package/dist/dts/routes/index.d.ts +4 -0
  64. package/dist/dts/routes/index.d.ts.map +1 -0
  65. package/dist/dts/routes/login-form/login-form.d.ts +27 -0
  66. package/dist/dts/routes/login-form/login-form.d.ts.map +1 -0
  67. package/dist/dts/routes/login-form/login-form.styles.d.ts +2 -0
  68. package/dist/dts/routes/login-form/login-form.styles.d.ts.map +1 -0
  69. package/dist/dts/routes/login-form/login-form.template.d.ts +3 -0
  70. package/dist/dts/routes/login-form/login-form.template.d.ts.map +1 -0
  71. package/dist/dts/routes/not-found/not-found.d.ts +4 -0
  72. package/dist/dts/routes/not-found/not-found.d.ts.map +1 -0
  73. package/dist/dts/routes/protected/protected.d.ts +5 -0
  74. package/dist/dts/routes/protected/protected.d.ts.map +1 -0
  75. package/dist/dts/routes/protected/protected.template.d.ts +3 -0
  76. package/dist/dts/routes/protected/protected.template.d.ts.map +1 -0
  77. package/dist/dts/routes/request-account/request-account.d.ts +6 -0
  78. package/dist/dts/routes/request-account/request-account.d.ts.map +1 -0
  79. package/dist/dts/routes/request-account/request-account.template.d.ts +3 -0
  80. package/dist/dts/routes/request-account/request-account.template.d.ts.map +1 -0
  81. package/dist/dts/routes/reset-password/reset-password.d.ts +14 -0
  82. package/dist/dts/routes/reset-password/reset-password.d.ts.map +1 -0
  83. package/dist/dts/routes/reset-password/reset-password.template.d.ts +3 -0
  84. package/dist/dts/routes/reset-password/reset-password.template.d.ts.map +1 -0
  85. package/dist/dts/routes/types.d.ts +29 -0
  86. package/dist/dts/routes/types.d.ts.map +1 -0
  87. package/dist/dts/routes/verify/verify.d.ts +6 -0
  88. package/dist/dts/routes/verify/verify.d.ts.map +1 -0
  89. package/dist/dts/routes/verify/verify.template.d.ts +3 -0
  90. package/dist/dts/routes/verify/verify.template.d.ts.map +1 -0
  91. package/dist/dts/styles/index.d.ts +3 -0
  92. package/dist/dts/styles/index.d.ts.map +1 -0
  93. package/dist/dts/styles/styles.d.ts +5 -0
  94. package/dist/dts/styles/styles.d.ts.map +1 -0
  95. package/dist/dts/styles/typography.d.ts +4 -0
  96. package/dist/dts/styles/typography.d.ts.map +1 -0
  97. package/dist/dts/utils/index.d.ts +2 -0
  98. package/dist/dts/utils/index.d.ts.map +1 -0
  99. package/dist/dts/utils/logger.d.ts +2 -0
  100. package/dist/dts/utils/logger.d.ts.map +1 -0
  101. package/dist/esm/assets/bg.jpg +0 -0
  102. package/dist/esm/assets/genesis-logo-dark.svg +32 -0
  103. package/dist/esm/assets/genesis-logo-light.svg +10 -0
  104. package/dist/esm/assets/genesis-logo-old.svg +36 -0
  105. package/dist/esm/components/components.js +49 -0
  106. package/dist/esm/components/components.js.map +1 -0
  107. package/dist/esm/components/index.js +2 -0
  108. package/dist/esm/components/index.js.map +1 -0
  109. package/dist/esm/index.federated.js +2 -0
  110. package/dist/esm/index.federated.js.map +1 -0
  111. package/dist/esm/index.js +3 -0
  112. package/dist/esm/index.js.map +1 -0
  113. package/dist/esm/layouts/default.js +28 -0
  114. package/dist/esm/layouts/default.js.map +1 -0
  115. package/dist/esm/layouts/index.js +2 -0
  116. package/dist/esm/layouts/index.js.map +1 -0
  117. package/dist/esm/main/config.js +153 -0
  118. package/dist/esm/main/config.js.map +1 -0
  119. package/dist/esm/main/define.js +31 -0
  120. package/dist/esm/main/define.js.map +1 -0
  121. package/dist/esm/main/index.js +7 -0
  122. package/dist/esm/main/index.js.map +1 -0
  123. package/dist/esm/main/main.definition.js +44 -0
  124. package/dist/esm/main/main.definition.js.map +1 -0
  125. package/dist/esm/main/main.js +234 -0
  126. package/dist/esm/main/main.js.map +1 -0
  127. package/dist/esm/main/main.styles.js +39 -0
  128. package/dist/esm/main/main.styles.js.map +1 -0
  129. package/dist/esm/main/main.template.js +15 -0
  130. package/dist/esm/main/main.template.js.map +1 -0
  131. package/dist/esm/routes/base.js +512 -0
  132. package/dist/esm/routes/base.js.map +1 -0
  133. package/dist/esm/routes/config.js +169 -0
  134. package/dist/esm/routes/config.js.map +1 -0
  135. package/dist/esm/routes/forgot-password/forgot-password.js +42 -0
  136. package/dist/esm/routes/forgot-password/forgot-password.js.map +1 -0
  137. package/dist/esm/routes/forgot-password/forgot-password.template.js +27 -0
  138. package/dist/esm/routes/forgot-password/forgot-password.template.js.map +1 -0
  139. package/dist/esm/routes/index.js +4 -0
  140. package/dist/esm/routes/index.js.map +1 -0
  141. package/dist/esm/routes/login-form/login-form.js +256 -0
  142. package/dist/esm/routes/login-form/login-form.js.map +1 -0
  143. package/dist/esm/routes/login-form/login-form.styles.js +79 -0
  144. package/dist/esm/routes/login-form/login-form.styles.js.map +1 -0
  145. package/dist/esm/routes/login-form/login-form.template.js +162 -0
  146. package/dist/esm/routes/login-form/login-form.template.js.map +1 -0
  147. package/dist/esm/routes/not-found/not-found.js +17 -0
  148. package/dist/esm/routes/not-found/not-found.js.map +1 -0
  149. package/dist/esm/routes/protected/protected.js +26 -0
  150. package/dist/esm/routes/protected/protected.js.map +1 -0
  151. package/dist/esm/routes/protected/protected.template.js +14 -0
  152. package/dist/esm/routes/protected/protected.template.js.map +1 -0
  153. package/dist/esm/routes/request-account/request-account.js +33 -0
  154. package/dist/esm/routes/request-account/request-account.js.map +1 -0
  155. package/dist/esm/routes/request-account/request-account.template.js +38 -0
  156. package/dist/esm/routes/request-account/request-account.template.js.map +1 -0
  157. package/dist/esm/routes/reset-password/reset-password.js +79 -0
  158. package/dist/esm/routes/reset-password/reset-password.js.map +1 -0
  159. package/dist/esm/routes/reset-password/reset-password.template.js +31 -0
  160. package/dist/esm/routes/reset-password/reset-password.template.js.map +1 -0
  161. package/dist/esm/routes/types.js +2 -0
  162. package/dist/esm/routes/types.js.map +1 -0
  163. package/dist/esm/routes/verify/verify.js +33 -0
  164. package/dist/esm/routes/verify/verify.js.map +1 -0
  165. package/dist/esm/routes/verify/verify.template.js +39 -0
  166. package/dist/esm/routes/verify/verify.template.js.map +1 -0
  167. package/dist/esm/styles/index.js +3 -0
  168. package/dist/esm/styles/index.js.map +1 -0
  169. package/dist/esm/styles/styles.js +145 -0
  170. package/dist/esm/styles/styles.js.map +1 -0
  171. package/dist/esm/styles/typography.js +27 -0
  172. package/dist/esm/styles/typography.js.map +1 -0
  173. package/dist/esm/utils/index.js +2 -0
  174. package/dist/esm/utils/index.js.map +1 -0
  175. package/dist/esm/utils/logger.js +3 -0
  176. package/dist/esm/utils/logger.js.map +1 -0
  177. package/dist/favicon.ico +0 -0
  178. package/dist/foundation-login.api.json +1598 -0
  179. package/dist/foundation-login.d.ts +758 -0
  180. package/dist/foundationLogin.51f4a45f08e04c340be2f7a5a21d203d.js.map +1 -0
  181. package/dist/index.ejs +23 -0
  182. package/dist/index.html +10 -0
  183. package/dist/info.ejs +13 -0
  184. package/dist/info.html +22 -0
  185. package/dist/main.6b8ef32149fa7ade387e34be21e80e9f.js.map +1 -0
  186. package/dist/main.f20fa5670484f5c57ef1.js +2 -0
  187. package/dist/npm.analytics.343.1691cbc7d8a5badd3734.js +2 -0
  188. package/dist/npm.analytics.ce2eefcbb0dbd8ec610f4a90f48aa689.js.map +1 -0
  189. package/dist/npm.consola.713.661cb6ae3806c228029d.js +2 -0
  190. package/dist/npm.consola.96aceeeb14c801e429604b872dd754d7.js.map +1 -0
  191. package/dist/npm.dialog-polyfill.47.34b0c0d52e6712cf91bb.js +2 -0
  192. package/dist/npm.dialog-polyfill.9d605973cbc29184d8b9b4736433dddc.js.map +1 -0
  193. package/dist/npm.finos.690.d012d887fab1a50fd3fd.js +2 -0
  194. package/dist/npm.finos.bb7f5996c8be19fd2a1c0bb82b2512ef.js.map +1 -0
  195. package/dist/npm.fortawesome.104.f45009da0a55a389999c.js +2 -0
  196. package/dist/npm.fortawesome.e10775e8f8583851351996b12aec3dfb.js.map +1 -0
  197. package/dist/npm.microsoft.127.7781d48b93413319f199.js +6406 -0
  198. package/dist/npm.microsoft.127.7781d48b93413319f199.js.LICENSE.txt +14 -0
  199. package/dist/npm.microsoft.b0947aa2f980f173ee68c35127bf2481.js.map +1 -0
  200. package/dist/npm.popperjs.47700ec72e909558c6ebe29941887dcf.js.map +1 -0
  201. package/dist/npm.popperjs.591.6ab52bc8e177edef695a.js +2 -0
  202. package/dist/npm.rxjs.271.210fdd198235c86ce4cd.js +2 -0
  203. package/dist/npm.rxjs.36e7291df63583daef7bbafd0a3ab9dc.js.map +1 -0
  204. package/dist/remoteEntry.js +2 -0
  205. package/dist/serve.json +3 -0
  206. package/dist/tsdoc-metadata.json +11 -0
  207. package/docs/.gitattributes +2 -0
  208. package/docs/api/foundation-login.configure.md +62 -0
  209. package/docs/api/foundation-login.defaultapihost.md +12 -0
  210. package/docs/api/foundation-login.defaultloginconfig.md +13 -0
  211. package/docs/api/foundation-login.defaultorganisation.md +12 -0
  212. package/docs/api/foundation-login.defaultpassword.md +12 -0
  213. package/docs/api/foundation-login.defaultsocketext.md +12 -0
  214. package/docs/api/foundation-login.defaulttemplateoptions.md +16 -0
  215. package/docs/api/foundation-login.defaultuser.md +12 -0
  216. package/docs/api/foundation-login.define.md +38 -0
  217. package/docs/api/foundation-login.definition.md +19 -0
  218. package/docs/api/foundation-login.fieldconfig.md +16 -0
  219. package/docs/api/foundation-login.fieldconfigmap.md +19 -0
  220. package/docs/api/foundation-login.hostenv.md +12 -0
  221. package/docs/api/foundation-login.hosturl.md +12 -0
  222. package/docs/api/foundation-login.idp.id.md +11 -0
  223. package/docs/api/foundation-login.idp.md +20 -0
  224. package/docs/api/foundation-login.idp.type.md +11 -0
  225. package/docs/api/foundation-login.idpresponse.id.md +11 -0
  226. package/docs/api/foundation-login.idpresponse.md +20 -0
  227. package/docs/api/foundation-login.idpresponse.type.md +11 -0
  228. package/docs/api/foundation-login.ismfroute.md +24 -0
  229. package/docs/api/foundation-login.login.md +108 -0
  230. package/docs/api/foundation-login.loginconfig.autoauth.md +18 -0
  231. package/docs/api/foundation-login.loginconfig.autoconnect.md +13 -0
  232. package/docs/api/foundation-login.loginconfig.background.md +30 -0
  233. package/docs/api/foundation-login.loginconfig.defaultredirecturl.md +18 -0
  234. package/docs/api/foundation-login.loginconfig.fields.md +18 -0
  235. package/docs/api/foundation-login.loginconfig.logo.md +28 -0
  236. package/docs/api/foundation-login.loginconfig.md +30 -0
  237. package/docs/api/foundation-login.loginconfig.omitredirecturls.md +21 -0
  238. package/docs/api/foundation-login.loginconfig.omitroutes.md +25 -0
  239. package/docs/api/foundation-login.loginconfig.showconnectionindicator.md +13 -0
  240. package/docs/api/foundation-login.loginconfig.sso.md +18 -0
  241. package/docs/api/foundation-login.loginconfig.versioninformation.md +25 -0
  242. package/docs/api/foundation-login.loginhosted.md +23 -0
  243. package/docs/api/foundation-login.loginhosted.registercommoncomponents.md +18 -0
  244. package/docs/api/foundation-login.md +59 -0
  245. package/docs/api/foundation-login.routes.md +20 -0
  246. package/docs/api/foundation-login.settings.md +20 -0
  247. package/docs/api/foundation-login.ssoconfig.md +15 -0
  248. package/docs/api/foundation-login.styles.md +12 -0
  249. package/docs/api/foundation-login.template.md +12 -0
  250. package/docs/api/foundation-login.templatecomponents.md +25 -0
  251. package/docs/api/foundation-login.templateoptions.md +19 -0
  252. package/docs/api/index.md +12 -0
  253. package/docs/api-report.md +380 -0
  254. package/docs/img/foundation-login_change-password.png +0 -0
  255. package/docs/img/foundation-login_forgotten-password.png +0 -0
  256. package/docs/img/foundation-login_login-sso.png +0 -0
  257. package/docs/img/foundation-login_login-standard.png +0 -0
  258. package/docs/img/foundation-login_request-account.png +0 -0
  259. package/license.txt +46 -0
  260. package/package.json +90 -0
@@ -0,0 +1,758 @@
1
+ import { Auth } from '@genesislcap/foundation-comms';
2
+ import { Binding } from '@microsoft/fast-element';
3
+ import { Connect } from '@genesislcap/foundation-comms';
4
+ import { Constructable } from '@microsoft/fast-element';
5
+ import { Container } from '@microsoft/fast-foundation';
6
+ import { CredentialManager } from '@genesislcap/foundation-comms';
7
+ import { DefineFunction } from '@genesislcap/foundation-ui';
8
+ import { ElementStyles } from '@microsoft/fast-element';
9
+ import { FASTElement } from '@microsoft/fast-element';
10
+ import { FoundationAnalytics } from '@genesislcap/foundation-comms';
11
+ import { InterfaceSymbol } from '@microsoft/fast-foundation';
12
+ import { Message } from '@genesislcap/foundation-comms';
13
+ import { MessageBuilder } from '@genesislcap/foundation-comms';
14
+ import { PartialFASTElementDefinition } from '@microsoft/fast-element';
15
+ import { RouterConfiguration } from '@microsoft/fast-router';
16
+ import { Session } from '@genesislcap/foundation-comms';
17
+ import { SyntheticViewTemplate } from '@microsoft/fast-element';
18
+ import { TemplateElementDependency } from '@genesislcap/foundation-ui';
19
+ import { ViewTemplate } from '@microsoft/fast-element';
20
+
21
+ /**
22
+ * @internal
23
+ */
24
+ export declare const backButton: <T extends ConfigHost>(binding: Binding) => ViewTemplate<T, any>;
25
+
26
+ /**
27
+ * @internal
28
+ * @privateRemarks
29
+ * Temp optimisation. How we handle images like this needs a broader review.
30
+ */
31
+ export declare class BackgroundElement extends ConfigHostElement {
32
+ connectedCallback(): void;
33
+ }
34
+
35
+ /**
36
+ * @internal
37
+ */
38
+ export declare class BaseRoute extends ConfigHostElement {
39
+ auth: Auth;
40
+ connect: Connect;
41
+ session: Session;
42
+ messageBuilder: MessageBuilder;
43
+ credentialManager: CredentialManager;
44
+ host: string;
45
+ organisation: string;
46
+ username: string;
47
+ email: string;
48
+ password: string;
49
+ password2: string;
50
+ showPasswords: boolean;
51
+ message: string;
52
+ hasErrors: boolean;
53
+ isSubmitting: boolean;
54
+ connectedCallback(): void;
55
+ onSubmit(): Promise<void>;
56
+ ensureConnection(): Promise<boolean>;
57
+ setError(message: string): void;
58
+ clearError(): void;
59
+ get orgUsername(): string;
60
+ onBack: () => Promise<void>;
61
+ onNavigate: (routeName: Routes, params?: {}) => Promise<void>;
62
+ queueOnBack(delay?: number): void;
63
+ autofill(): Promise<boolean>;
64
+ storeCredentials(password?: string): void;
65
+ sendMessage<T = any>(message: Message<T>, successFeedback?: string, successCallback?: (result: any) => void): Promise<void>;
66
+ }
67
+
68
+ /**
69
+ * @internal
70
+ */
71
+ export declare type ConfigHost = {
72
+ config: LoginConfig;
73
+ };
74
+
75
+ /**
76
+ * @internal
77
+ * @privateRemarks
78
+ * For services / constructor injection, using @optional(LoginConfig) config = defaultLoginConfig; works as expected.
79
+ * However, for elements, the @optional decorator isn't viable. This base element provides an alternative approach.
80
+ */
81
+ export declare class ConfigHostElement extends FASTElement implements ConfigHost {
82
+ container: Container;
83
+ config: LoginConfig;
84
+ connectedCallback(): void;
85
+ }
86
+
87
+ /**
88
+ * @internal
89
+ * @privateRemarks
90
+ * Potential optimisation ahead of workflow / statemachine based smart forms integration, but needs tagFor.
91
+ * Feels a bit at odds with the declarative nature we're aiming for, but will await review.
92
+ */
93
+ export declare const configurableTextField: <T extends ConfigHost>(name: keyof FieldConfigMap | [name: keyof FieldConfigMap, valueKey: string], type: string, autofocus?: boolean, autocomplete?: string, className?: string, labelOverride?: string, testIdOverride?: string, required?: boolean) => ViewTemplate<T, any>;
94
+
95
+ /**
96
+ * Configure the login micro frontend settings.
97
+ *
98
+ * @remarks
99
+ * This is primarily for general settings, rather than re-defining the element, static templating / style changes.
100
+ *
101
+ * @param container - DI container.
102
+ * @param config - A partial LoginConfig.
103
+ *
104
+ * @example Configuring login on lazy load
105
+ * ```ts
106
+ * name: 'login',
107
+ * path: 'login',
108
+ * title: 'Login',
109
+ * element: async () => {
110
+ * const { configure, define, defaultLoginConfig } = await import('@genesislcap/foundation-login');
111
+ * configure(this.container, {
112
+ * autoConnect: true,
113
+ * omitRoutes: ['request-account'],
114
+ * fields: {
115
+ * ...defaultLoginConfig.fields,
116
+ * organisation: {
117
+ * label: 'CompID',
118
+ * },
119
+ * },
120
+ * defaultRedirectUrl: 'dashboard',
121
+ * logo: loginLogo,
122
+ * background: loginBG,
123
+ * });
124
+ * // You can import and return `Login` directly here or re-define it completely via `define`.
125
+ * return define({
126
+ * name: `nexus-login`,
127
+ * });
128
+ * },
129
+ * layout: loginLayout,
130
+ * settings: { public: true },
131
+ * childRouters: true,
132
+ * ```
133
+ *
134
+ * @public
135
+ * @privateRemarks
136
+ * We can tailor the spreading logic after we put it to use. Keeping it simple for now.
137
+ */
138
+ export declare function configure(container: Container, config: Partial<LoginConfig>): void;
139
+
140
+ /**
141
+ * @public
142
+ */
143
+ export declare const defaultApiHost: string;
144
+
145
+ /**
146
+ * Default LoginConfig DI implementation.
147
+ * @public
148
+ */
149
+ export declare const defaultLoginConfig: LoginConfig;
150
+
151
+ /**
152
+ * @internal
153
+ */
154
+ export declare const defaultOnBackMS = 3000;
155
+
156
+ /**
157
+ * @public
158
+ */
159
+ export declare const defaultOrganisation: string;
160
+
161
+ /**
162
+ * @public
163
+ */
164
+ export declare const defaultPassword: string;
165
+
166
+ /**
167
+ * @public
168
+ */
169
+ export declare const defaultSocketExt: string;
170
+
171
+ /**
172
+ * The default template options this MF has been created with.
173
+ * @beta
174
+ * @privateRemarks
175
+ * This will likely evolve into the shell style PWA + FDC3 manifest setup, but that needs more work to evolve into MVP.
176
+ * Hosts should be able to figure out everything they will need to do to fully customise a MF. Currently, they
177
+ * import these `defaultTemplateOptions` and the host dev overrides. Each TemplateComponents key must be a mandatory
178
+ * override, given in hosted mode the MFs won't be registering fallbacks as this would be wasteful, bloat etc.
179
+ * I've added the components list to the package.json > config block for now, but I'm not using it here.
180
+ */
181
+ export declare const defaultTemplateOptions: TemplateOptions;
182
+
183
+ /**
184
+ * @public
185
+ */
186
+ export declare const defaultUser: string;
187
+
188
+ /**
189
+ * Re-define the login micro frontend.
190
+ *
191
+ * @example
192
+ * ```ts
193
+ * import { define, styles, template, defaultTemplateOptions } from '@genesislcap/foundation-login';
194
+ * const customTemplateOptions = {
195
+ * ...defaultTemplateOptions,
196
+ * ...customOptions,
197
+ * }
198
+ * export const AppLogin = define({
199
+ * name: `nexus-login`,
200
+ * template: template(customTemplateOptions),
201
+ * styles: css`
202
+ * ${styles(customTemplateOptions)}
203
+ * some-element {
204
+ * background-color: #ff00b4;
205
+ * }
206
+ * `,
207
+ * });
208
+ * ```
209
+ *
210
+ * @beta
211
+ * @privateRemarks
212
+ * TODO: Use LoginHosted instead of Login when elements manifest stuff lands, which will drive tagFor etc.
213
+ */
214
+ export declare const define: DefineFunction<typeof Login>;
215
+
216
+ /**
217
+ * @beta
218
+ * @remarks
219
+ * This is the main definition of this micro frontend which is exposed for user reconfiguration.
220
+ */
221
+ export declare const definition: PartialFASTElementDefinition;
222
+
223
+ /**
224
+ * @internal
225
+ */
226
+ export declare const emailField: <T extends BaseRoute>() => ViewTemplate<T, any>;
227
+
228
+ /**
229
+ * @public
230
+ * Could be expanded to allow field ViewTemplates.
231
+ */
232
+ export declare type FieldConfig = {
233
+ label: string;
234
+ /**
235
+ * @privateRemarks
236
+ * Added for now to apply defaults, but I'm not convinced we should do this. Could be made reactive after upgrade.
237
+ */
238
+ value?: any;
239
+ };
240
+
241
+ /**
242
+ * @public
243
+ * @privateRemarks
244
+ * Using null to exclude the organisation field rather than boolean, as it affords cleaner value lookups in the templates.
245
+ */
246
+ export declare type FieldConfigMap = {
247
+ organisation: FieldConfig | null;
248
+ username: FieldConfig;
249
+ email: FieldConfig;
250
+ password: FieldConfig;
251
+ };
252
+
253
+ /**
254
+ * @public
255
+ */
256
+ export declare const hostEnv: string;
257
+
258
+ /**
259
+ * @public
260
+ */
261
+ export declare const hostUrl: string;
262
+
263
+ /**
264
+ * @public
265
+ */
266
+ export declare interface IDP {
267
+ id: string;
268
+ type: string;
269
+ }
270
+
271
+ /**
272
+ * @public
273
+ */
274
+ export declare interface IDPResponse {
275
+ ID: string;
276
+ TYPE: string;
277
+ }
278
+
279
+ /**
280
+ * A utility to check if a pathname is a route of this micro frontend.
281
+ *
282
+ * @param pathname - A pathname string to check, typically location.pathname, which is used when a value is omitted.
283
+ *
284
+ * @public
285
+ * @privateRemarks
286
+ * I've just put this util in for now given there's some app level direction code in place which needs review.
287
+ */
288
+ export declare function isMFRoute(pathname?: string): boolean;
289
+
290
+ /**
291
+ * Defines the login class which handles account authentication from the front-end
292
+ *
293
+ * @remarks
294
+ *
295
+ * Add the Login class as a router element, and it will handle the account authentication for you.
296
+ * Requires use of `@genesislcap/foundation-comms` for the {@link @genesislcap/foundation-comms#Auth | Auth} and
297
+ * {@link @genesislcap/foundation#Session | Session} classes.
298
+ *
299
+ * There are a lot of configuration options available, and different authentication types (such as login via SSO). Use
300
+ * the modules exported `configure` and `define` functions for more power.
301
+ *
302
+ * @example
303
+ * The following is an example of using it in your app, setting it up in the router configuration. This isn't a complete
304
+ * routes confutation, but it contains all required configuration in regard to adding Login functionality.
305
+ * ```ts
306
+ * // Import required dependencies from the foundation-login package
307
+ * import { Login } from '@genesislcap/foundation-login';
308
+ * // Import required dependencies from the foundation-comms package
309
+ * // You could also import analytics events and set them up in the NavigationContributor
310
+ * import { Auth, Session } from '@genesislcap/foundation-comms';
311
+ *
312
+ * type RouterSettings = {
313
+ * public?: boolean;
314
+ * autoAuth?: boolean;
315
+ * }
316
+ *
317
+ * // Define your router config
318
+ * export class MainRouterConfig extends RouterConfiguration<RouterSettings> {
319
+ * // Ensure you inject in required dependencies
320
+ * constructor(
321
+ * @Auth private auth: Auth,
322
+ * @Session private session: Session
323
+ * ) {
324
+ * super();
325
+ * }
326
+ *
327
+ * // Add Login as a route
328
+ * public configure() {
329
+ * ...
330
+ * this.routes.map(
331
+ * { path: '', redirect: 'login' },
332
+ * {
333
+ * path: 'login',
334
+ * element: Login,
335
+ * title: 'Login',
336
+ * name: 'login',
337
+ * layout: loginLayout,
338
+ * settings: { public: true },
339
+ * childRouters: true,
340
+ * },
341
+ * ... // Other routes config here
342
+ * );
343
+ *
344
+ * const session = this.session;
345
+ * const auth = this.auth;
346
+ *
347
+ * // Example of a FallbackRouteDefinition
348
+ * this.routes.fallback(() =>
349
+ * auth.isLoggedIn ? { redirect: 'not-found' } : { redirect: 'login' }
350
+ * );
351
+ *
352
+ * // Example of a NavigationContributor
353
+ * this.contributors.push({
354
+ * navigate: async (phase) => {
355
+ * const settings = phase.route.settings;
356
+ *
357
+ * // Could add in processes such as analytics here
358
+ *
359
+ * // If public route don't block
360
+ * if (settings && settings.public) {
361
+ * return;
362
+ * }
363
+ *
364
+ * // If logged in don't block
365
+ * if (auth.isLoggedIn) {
366
+ * return;
367
+ * }
368
+ *
369
+ * // If autoAuth and session is valid try to connect+auto-login
370
+ * if (settings && settings.autoAuth && (await auth.reAuthFromSession())) {
371
+ * return;
372
+ * }
373
+ *
374
+ * // Otherwise route them to login
375
+ * phase.cancel(() => {
376
+ * session.captureReturnUrl();
377
+ * Route.name.replace(phase.router, 'login');
378
+ * });
379
+ * },
380
+ * });
381
+ * }
382
+ *
383
+ * ... // Other configuration/methods
384
+ *
385
+ * }
386
+ * ```
387
+ *
388
+ * @public
389
+ */
390
+ export declare class Login extends FASTElement {
391
+ /**
392
+ * Configuration for the routes and their associated settings.
393
+ * The client would override this in their app with their own settings to set
394
+ * their routes up as desired
395
+ * @internal
396
+ */
397
+ config: MainRouterConfig;
398
+ /**
399
+ * The DI container used to register required components in {@link Login.registerDIDependencies}
400
+ * @internal
401
+ */
402
+ container: Container;
403
+ /**
404
+ * Session controller used to manage the user's session
405
+ * @internal
406
+ */
407
+ session: Session;
408
+ /**
409
+ * Marked true when remote components are loaded, currently unused.
410
+ * @internal
411
+ */
412
+ ready: boolean;
413
+ /**
414
+ * DS provider / root level template.
415
+ * @internal
416
+ */
417
+ provider: FASTElement;
418
+ /**
419
+ * @internal
420
+ */
421
+ connectedCallback(): Promise<void>;
422
+ /**
423
+ * Used to forward the user onto a logged-in session during an SSO journey
424
+ *
425
+ * @remarks
426
+ *
427
+ * Called when loading the login page via the connectedCallback() method.
428
+ * During normal flows there will be no SSO tokens set and hence this function
429
+ * will quit execution.
430
+ * During an SSO journey the SSO provider will set the SSO token as a URLSearchParams
431
+ * parameter and redirect back to us. In this case we will take this and forward the
432
+ * user on, with their logged in session.
433
+ *
434
+ * There are two paths the user can take here - if they are in a popup
435
+ * (window.opener exists) then we need to set the session and get the parent window
436
+ * (the one which the user wants their session on) to refresh, and close the popup.
437
+ *
438
+ * Or if they are not in a popup then we simply set the ssoToken in the session.
439
+ * When this component is loaded with the ssoToken then it will redirect the
440
+ * user to their app (the `defaultRedirectUrl`).
441
+ *
442
+ * @internal
443
+ */
444
+ checkForSSOToken(): void;
445
+ /**
446
+ * Called from the connectedCallback
447
+ * @internal
448
+ */
449
+ registerCommonComponents(): Promise<void>;
450
+ /**
451
+ * @internal
452
+ */
453
+ protected registerDIDependencies(): void;
454
+ }
455
+
456
+ /**
457
+ * LoginConfig DI interface.
458
+ *
459
+ * @public
460
+ */
461
+ export declare interface LoginConfig {
462
+ /**
463
+ * Connect automatically or require user to click a connect button.
464
+ */
465
+ autoConnect: boolean;
466
+ /**
467
+ * Login automatically or require user to click a login button after a connection is established.
468
+ *
469
+ * @remarks
470
+ * Needs to manually be enabled in the NavigationContributor (see [2] in the example in the {@link Login} class).
471
+ */
472
+ autoAuth: boolean;
473
+ /**
474
+ * Logo styles.
475
+ *
476
+ * @remarks
477
+ * Providing `null` will hide the logo. Use content: url(...); to set source.
478
+ *
479
+ * @example Setting a custom logo
480
+ * ```ts
481
+ * logo: css`
482
+ * content: url(${customLogoImport});
483
+ * `,
484
+ * ```
485
+ */
486
+ logo: ElementStyles | null;
487
+ /**
488
+ * Background styles.
489
+ *
490
+ * @remarks
491
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background} for more information.
492
+ *
493
+ * @example Setting a custom background image
494
+ * ```ts
495
+ * background: css`
496
+ * :host {
497
+ * background-image: url(${customBGImport});
498
+ * }
499
+ * `,
500
+ * ```
501
+ */
502
+ background: ElementStyles;
503
+ /**
504
+ * Omit any of the internal routes except 'login' and 'not-found'.
505
+ *
506
+ * @remarks
507
+ * Routes specified here will not be configured nor will any internal cross-links to them be displayed.
508
+ *
509
+ * @example
510
+ * ```ts
511
+ * omitRoutes: ['request-account'],
512
+ * ```
513
+ */
514
+ omitRoutes: Exclude<Routes, 'login' | 'not-found'>[];
515
+ /**
516
+ * Map of configuration for each of the primary form fields.
517
+ *
518
+ * @remarks
519
+ * Use to drive inclusion / exclusion, tailor labels etc.
520
+ */
521
+ fields: FieldConfigMap;
522
+ /**
523
+ * Show or hide the connection status indicator.
524
+ */
525
+ showConnectionIndicator: boolean;
526
+ /**
527
+ * The default URL to route the user to after a successful login.
528
+ *
529
+ * @remarks
530
+ * Session.returnUrl set via Session.captureReturnUrl() trumps this value.
531
+ */
532
+ defaultRedirectUrl: string;
533
+ /**
534
+ * Omit certain return urls which the session service may have captured.
535
+ *
536
+ * @example
537
+ * ```ts
538
+ * omitRedirectUrls: ['/not-found'],
539
+ * ```
540
+ */
541
+ omitRedirectUrls: string[];
542
+ /**
543
+ * SSO configuration.
544
+ *
545
+ * @remarks
546
+ * Providing `null` excludes the SSO journey option completely.
547
+ */
548
+ sso: SSOConfig | null;
549
+ /**
550
+ * Display arbitrary version information.
551
+ *
552
+ * @remarks
553
+ * Applications may choose to set this to display their Application release version on the login form.
554
+ *
555
+ * @example
556
+ * ```ts
557
+ * versionInformation: 'Version 3.0.0',
558
+ * ```
559
+ */
560
+ versionInformation?: string;
561
+ }
562
+
563
+ /**
564
+ * LoginConfig DI key.
565
+ *
566
+ * @internal
567
+ * @privateRemarks
568
+ * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
569
+ */
570
+ export declare const LoginConfig: InterfaceSymbol<LoginConfig>;
571
+
572
+ /**
573
+ * @beta
574
+ * @privateRemarks
575
+ * A hosted version of the MF that doesn't set up a design system or components. This is what apps would use to truly
576
+ * customise the MF for their needs via define.ts.
577
+ */
578
+ export declare class LoginHosted extends Login {
579
+ registerCommonComponents(): Promise<void>;
580
+ }
581
+
582
+ /**
583
+ * @internal
584
+ */
585
+ export declare class LogoElement extends ConfigHostElement {
586
+ }
587
+
588
+ /**
589
+ * Base implementation of a routing used with the Login class
590
+ *
591
+ * @remarks
592
+ *
593
+ * Could be used when using the Login class as a standalone authentication method
594
+ * with your app
595
+ *
596
+ * @internal
597
+ */
598
+ export declare class MainRouterConfig extends RouterConfiguration<Settings> {
599
+ private auth;
600
+ private container;
601
+ private analytics;
602
+ private session;
603
+ private loginConfig;
604
+ constructor(auth: Auth, container: Container, analytics: FoundationAnalytics, session: Session, loginConfig?: LoginConfig);
605
+ configure(): void;
606
+ construct<T>(Type: Constructable<T>): T;
607
+ }
608
+
609
+ /**
610
+ * @internal
611
+ * @privateRemarks
612
+ * Temp optimisation. How we handle images like this needs a broader review.
613
+ */
614
+ export declare class MessageElement extends FASTElement {
615
+ classNames: string;
616
+ message: string;
617
+ nonError: boolean;
618
+ nonErrorChanged(): void;
619
+ }
620
+
621
+ /**
622
+ * @internal
623
+ */
624
+ export declare const organisationField: <T extends BaseRoute>() => ViewTemplate<T, any>;
625
+
626
+ /**
627
+ * @internal
628
+ */
629
+ export declare const password2Field: <T extends BaseRoute>(type: 'new' | 'confirmation') => ViewTemplate<T, any>;
630
+
631
+ /**
632
+ * @internal
633
+ */
634
+ export declare const passwordField: <T extends BaseRoute>(label?: string) => ViewTemplate<T, any>;
635
+
636
+ /**
637
+ * @public
638
+ */
639
+ export declare const Routes: {
640
+ readonly login: "login";
641
+ readonly 'request-account': "request-account";
642
+ readonly 'reset-password': "reset-password";
643
+ readonly 'forgot-password': "forgot-password";
644
+ readonly verify: "verify";
645
+ readonly protected: "protected";
646
+ readonly 'not-found': "not-found";
647
+ };
648
+
649
+ /**
650
+ * @public
651
+ */
652
+ export declare type Routes = (typeof Routes)[keyof typeof Routes];
653
+
654
+ /**
655
+ * Defines the parameters you may set on the routes.
656
+ *
657
+ * @remarks
658
+ * See the example in the {@link Login} class in the router's `configure` method for usage. All parameters are Optional.
659
+ *
660
+ * @public
661
+ */
662
+ export declare type Settings = {
663
+ /**
664
+ * Controls whether the user has to be logged in to view.
665
+ */
666
+ public?: boolean;
667
+ };
668
+
669
+ /**
670
+ * @internal
671
+ */
672
+ export declare const showPasswordsCheckbox: <T extends BaseRoute>() => ViewTemplate<T, any>;
673
+
674
+ /**
675
+ * @public
676
+ */
677
+ export declare type SSOConfig = {
678
+ /**
679
+ * Optionally toggle the SSO journey on/off by default.
680
+ */
681
+ toggled?: boolean;
682
+ /**
683
+ * The identity providers path under the current host.
684
+ *
685
+ * @example
686
+ * ```ts
687
+ * identityProvidersPath: 'sso/list'
688
+ * ```
689
+ */
690
+ identityProvidersPath: string;
691
+ };
692
+
693
+ /**
694
+ * @internal
695
+ * @privateRemarks
696
+ * This is used during development of this micro frontend.
697
+ */
698
+ export declare const standaloneDefinition: PartialFASTElementDefinition;
699
+
700
+ /**
701
+ * @public
702
+ * @privateRemarks
703
+ * Options cam be used to target unknown component tags in the css, such as:
704
+ * const buttonTag = tagFor(options.button);
705
+ * ...
706
+ * ${buttonTag} {
707
+ * width: 200px;
708
+ * }
709
+ */
710
+ export declare const styles: (options: TemplateOptions) => ElementStyles;
711
+
712
+ /**
713
+ * @internal
714
+ */
715
+ export declare const submitButton: <T extends ConfigHost>(label: string, dataTestId?: string, disabled?: boolean) => ViewTemplate<T, any>;
716
+
717
+ /**
718
+ * @internal
719
+ */
720
+ export declare class SubmittingIndicator extends FASTElement {
721
+ isSubmitting: boolean;
722
+ }
723
+
724
+ /**
725
+ * @public
726
+ */
727
+ export declare const template: (options: TemplateOptions) => ViewTemplate<Login, any>;
728
+
729
+ /**
730
+ * @beta
731
+ * @privateRemarks
732
+ * The CLI can be used to monitor what is in use and needs a mapping.
733
+ */
734
+ export declare type TemplateComponents = {
735
+ anchor: TemplateElementDependency;
736
+ button: TemplateElementDependency;
737
+ card: TemplateElementDependency;
738
+ checkbox: TemplateElementDependency;
739
+ listboxOption: TemplateElementDependency;
740
+ provider: TemplateElementDependency;
741
+ router: TemplateElementDependency;
742
+ select: TemplateElementDependency;
743
+ textField: TemplateElementDependency;
744
+ };
745
+
746
+ /**
747
+ * @beta
748
+ */
749
+ export declare type TemplateOptions = TemplateComponents & {
750
+ somePartial?: string | SyntheticViewTemplate;
751
+ };
752
+
753
+ /**
754
+ * @internal
755
+ */
756
+ export declare const usernameField: <T extends BaseRoute>() => ViewTemplate<T, any>;
757
+
758
+ export { }