@genesislcap/foundation-auth 14.71.1-auth-mf.21 → 14.99.0-auth-mf.22

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 (191) hide show
  1. package/README.md +27 -11
  2. package/dist/dts/components/zero-components.d.ts.map +1 -1
  3. package/dist/dts/config/config.d.ts +0 -9
  4. package/dist/dts/config/config.d.ts.map +1 -1
  5. package/dist/dts/config/templates.d.ts +1 -0
  6. package/dist/dts/config/templates.d.ts.map +1 -1
  7. package/dist/dts/dto/IDP.d.ts +9 -0
  8. package/dist/dts/dto/IDP.d.ts.map +1 -0
  9. package/dist/dts/dto/index.d.ts +1 -0
  10. package/dist/dts/dto/index.d.ts.map +1 -1
  11. package/dist/dts/entity/idp.d.ts +9 -0
  12. package/dist/dts/entity/idp.d.ts.map +1 -0
  13. package/dist/dts/entity/index.d.ts +1 -0
  14. package/dist/dts/entity/index.d.ts.map +1 -1
  15. package/dist/dts/entity/loginNack.d.ts +2 -0
  16. package/dist/dts/entity/loginNack.d.ts.map +1 -1
  17. package/dist/dts/entity/nack.d.ts +4 -0
  18. package/dist/dts/entity/nack.d.ts.map +1 -1
  19. package/dist/dts/env.d.ts +10 -0
  20. package/dist/dts/env.d.ts.map +1 -1
  21. package/dist/dts/machine/actions.d.ts +15 -0
  22. package/dist/dts/machine/actions.d.ts.map +1 -0
  23. package/dist/dts/machine/errors.d.ts +26 -0
  24. package/dist/dts/machine/errors.d.ts.map +1 -0
  25. package/dist/dts/machine/guards.d.ts +9 -0
  26. package/dist/dts/machine/guards.d.ts.map +1 -0
  27. package/dist/dts/machine/index.d.ts +2 -0
  28. package/dist/dts/machine/index.d.ts.map +1 -1
  29. package/dist/dts/machine/machine.d.ts +1 -1
  30. package/dist/dts/machine/machine.d.ts.map +1 -1
  31. package/dist/dts/main/main.d.ts +36 -3
  32. package/dist/dts/main/main.d.ts.map +1 -1
  33. package/dist/dts/main/main.styles.d.ts.map +1 -1
  34. package/dist/dts/main/main.template.d.ts +8 -0
  35. package/dist/dts/main/main.template.d.ts.map +1 -1
  36. package/dist/dts/mapper/loginMapper.d.ts.map +1 -1
  37. package/dist/dts/mapper/passwordManagementMapper.d.ts +1 -1
  38. package/dist/dts/mapper/passwordManagementMapper.d.ts.map +1 -1
  39. package/dist/dts/mapper/types.d.ts +2 -2
  40. package/dist/dts/mapper/utils.d.ts +20 -10
  41. package/dist/dts/mapper/utils.d.ts.map +1 -1
  42. package/dist/dts/routes/base.d.ts +4 -11
  43. package/dist/dts/routes/base.d.ts.map +1 -1
  44. package/dist/dts/routes/forgot-password/forgot-password.d.ts +0 -1
  45. package/dist/dts/routes/forgot-password/forgot-password.d.ts.map +1 -1
  46. package/dist/dts/routes/index.d.ts +0 -1
  47. package/dist/dts/routes/index.d.ts.map +1 -1
  48. package/dist/dts/routes/login/login.d.ts +1 -1
  49. package/dist/dts/routes/login/login.d.ts.map +1 -1
  50. package/dist/dts/routes/reset-password/reset-password.d.ts +0 -1
  51. package/dist/dts/routes/reset-password/reset-password.d.ts.map +1 -1
  52. package/dist/dts/services/idp.d.ts +41 -0
  53. package/dist/dts/services/idp.d.ts.map +1 -0
  54. package/dist/dts/services/index.d.ts +2 -0
  55. package/dist/dts/services/index.d.ts.map +1 -0
  56. package/dist/dts/store/auth.d.ts +17 -4
  57. package/dist/dts/store/auth.d.ts.map +1 -1
  58. package/dist/dts/store/authFormEntry.d.ts +56 -20
  59. package/dist/dts/store/authFormEntry.d.ts.map +1 -1
  60. package/dist/dts/tags/tags.d.ts +2 -5
  61. package/dist/dts/tags/tags.d.ts.map +1 -1
  62. package/dist/dts/utils/index.d.ts +0 -1
  63. package/dist/dts/utils/index.d.ts.map +1 -1
  64. package/dist/dts/utils/logger.d.ts +1 -1
  65. package/dist/dts/utils/logger.d.ts.map +1 -1
  66. package/dist/esm/components/zero-components.js +2 -2
  67. package/dist/esm/config/config.js +1 -1
  68. package/dist/esm/config/templates.js +1 -0
  69. package/dist/esm/dto/IDP.js +1 -0
  70. package/dist/esm/entity/idp.js +1 -0
  71. package/dist/esm/entity/index.js +1 -0
  72. package/dist/esm/env.js +29 -1
  73. package/dist/esm/machine/actions.js +24 -0
  74. package/dist/esm/machine/errors.js +40 -0
  75. package/dist/esm/machine/guards.js +11 -0
  76. package/dist/esm/machine/index.js +2 -0
  77. package/dist/esm/machine/machine.js +57 -66
  78. package/dist/esm/main/main.js +53 -3
  79. package/dist/esm/main/main.styles.js +7 -1
  80. package/dist/esm/main/main.template.js +16 -3
  81. package/dist/esm/mapper/loginMapper.js +2 -2
  82. package/dist/esm/mapper/passwordManagementMapper.js +1 -1
  83. package/dist/esm/mapper/utils.js +69 -13
  84. package/dist/esm/routes/base.js +9 -13
  85. package/dist/esm/routes/config.js +1 -1
  86. package/dist/esm/routes/forgot-password/forgot-password.js +0 -4
  87. package/dist/esm/routes/index.js +0 -1
  88. package/dist/esm/routes/login/login.js +13 -12
  89. package/dist/esm/routes/login/login.template.js +3 -3
  90. package/dist/esm/routes/reset-password/reset-password.js +0 -4
  91. package/dist/esm/services/idp.js +71 -0
  92. package/dist/esm/services/index.js +1 -0
  93. package/dist/esm/store/auth.js +25 -3
  94. package/dist/esm/store/authFormEntry.js +68 -49
  95. package/dist/esm/tags/tags.js +2 -20
  96. package/dist/esm/utils/index.js +0 -1
  97. package/dist/esm/utils/logger.js +1 -1
  98. package/dist/foundation-auth.api.json +816 -769
  99. package/dist/foundation-auth.d.ts +210 -91
  100. package/docs/api/foundation-auth.authformentryeventmap.md +1 -1
  101. package/docs/api/foundation-auth.authformentrystore.idps.md +1 -1
  102. package/docs/api/foundation-auth.authformentrystore.md +4 -6
  103. package/docs/api/foundation-auth.authformentrystore.onselectedidpchanged.md +3 -3
  104. package/docs/api/foundation-auth.authformentrystore.password2.md +5 -0
  105. package/docs/api/foundation-auth.authformentrystore.selectedidp.md +3 -3
  106. package/docs/api/{foundation-auth.authformentrystore.host.md → foundation-auth.authformentrystore.ssologinurl.md} +3 -3
  107. package/docs/api/foundation-auth.authstore.errormessages.md +11 -0
  108. package/docs/api/foundation-auth.authstore.md +2 -0
  109. package/docs/api/foundation-auth.authstore.metamessages.md +11 -0
  110. package/docs/api/foundation-auth.defaultauthformentrystore.autofilling.md +1 -0
  111. package/docs/api/foundation-auth.defaultauthformentrystore.email.md +1 -0
  112. package/docs/api/foundation-auth.defaultauthformentrystore.haspasswordexpired.md +1 -0
  113. package/docs/api/foundation-auth.defaultauthformentrystore.idps.md +2 -1
  114. package/docs/api/{foundation-auth.defaultauthformentrystore.haserrors.md → foundation-auth.defaultauthformentrystore.idpservice.md} +3 -3
  115. package/docs/api/foundation-auth.defaultauthformentrystore.md +6 -16
  116. package/docs/api/foundation-auth.defaultauthformentrystore.mfacode.md +1 -0
  117. package/docs/api/foundation-auth.defaultauthformentrystore.onautofillform.md +1 -0
  118. package/docs/api/foundation-auth.defaultauthformentrystore.onemailchanged.md +1 -0
  119. package/docs/api/foundation-auth.defaultauthformentrystore.onorganisationchanged.md +1 -0
  120. package/docs/api/foundation-auth.defaultauthformentrystore.onpassword2changed.md +1 -0
  121. package/docs/api/foundation-auth.defaultauthformentrystore.onpasswordchanged.md +1 -0
  122. package/docs/api/foundation-auth.defaultauthformentrystore.onselectedidpchanged.md +4 -3
  123. package/docs/api/foundation-auth.defaultauthformentrystore.onshowpasswordschanged.md +1 -0
  124. package/docs/api/foundation-auth.defaultauthformentrystore.onssotogglechanged.md +1 -0
  125. package/docs/api/foundation-auth.defaultauthformentrystore.onusernamechanged.md +1 -0
  126. package/docs/api/foundation-auth.defaultauthformentrystore.organisation.md +1 -0
  127. package/docs/api/foundation-auth.defaultauthformentrystore.orgusername.md +1 -0
  128. package/docs/api/foundation-auth.defaultauthformentrystore.password.md +1 -0
  129. package/docs/api/foundation-auth.defaultauthformentrystore.password2.md +5 -0
  130. package/docs/api/foundation-auth.defaultauthformentrystore.passwordresettoken.md +1 -0
  131. package/docs/api/foundation-auth.defaultauthformentrystore.selectedidp.md +4 -3
  132. package/docs/api/foundation-auth.defaultauthformentrystore.showpasswords.md +1 -0
  133. package/docs/api/{foundation-auth.defaultauthformentrystore.message.md → foundation-auth.defaultauthformentrystore.ssologinurl.md} +4 -3
  134. package/docs/api/foundation-auth.defaultauthformentrystore.ssotoggled.md +1 -0
  135. package/docs/api/foundation-auth.defaultauthformentrystore.termsagreed.md +1 -0
  136. package/docs/api/foundation-auth.defaultauthformentrystore.username.md +1 -0
  137. package/docs/api/foundation-auth.defaultauthmachine._constructor_.md +1 -1
  138. package/docs/api/{foundation-auth.defaultauthmachine.ondonedto.md → foundation-auth.defaultauthmachine.dtotransition.md} +3 -3
  139. package/docs/api/foundation-auth.defaultauthmachine.md +1 -1
  140. package/docs/api/foundation-auth.defaultauthstore.errormessages.md +12 -0
  141. package/docs/api/foundation-auth.defaultauthstore.ispending.md +1 -0
  142. package/docs/api/foundation-auth.defaultauthstore.md +3 -1
  143. package/docs/api/foundation-auth.defaultauthstore.metamessages.md +12 -0
  144. package/docs/api/foundation-auth.defaultauthstore.onchangepassword.md +1 -0
  145. package/docs/api/foundation-auth.defaultauthstore.onforgotpassword.md +1 -0
  146. package/docs/api/foundation-auth.defaultauthstore.onlogin.md +1 -0
  147. package/docs/api/foundation-auth.defaultauthstore.onlogout.md +1 -0
  148. package/docs/api/foundation-auth.defaultauthstore.onresetpassword.md +1 -0
  149. package/docs/api/{foundation-auth.idpresponse.id.md → foundation-auth.fromidpdto.md} +5 -3
  150. package/docs/api/foundation-auth.idp.description.md +11 -0
  151. package/docs/api/foundation-auth.idp.id.md +3 -3
  152. package/docs/api/foundation-auth.idp.md +3 -2
  153. package/docs/api/foundation-auth.idp.type.md +3 -3
  154. package/docs/api/foundation-auth.is200nack.md +13 -0
  155. package/docs/api/foundation-auth.isnackdto.md +1 -1
  156. package/docs/api/foundation-auth.isnackentity.md +24 -0
  157. package/docs/api/foundation-auth.loadingtemplate.md +12 -0
  158. package/docs/api/foundation-auth.logger.md +1 -1
  159. package/docs/api/foundation-auth.loginnack.hasincorrectcredentials.md +11 -0
  160. package/docs/api/foundation-auth.loginnack.maxtriesreached.md +11 -0
  161. package/docs/api/foundation-auth.loginnack.md +2 -0
  162. package/docs/api/foundation-auth.md +12 -11
  163. package/docs/api/foundation-auth.routertemplate.md +12 -0
  164. package/docs/api/foundation-auth.seterror.md +25 -0
  165. package/docs/api/{foundation-auth.idpresponse.type.md → foundation-auth.sso_list_url.md} +4 -3
  166. package/docs/api/foundation-auth.sso_login_url.md +12 -0
  167. package/docs/api/foundation-auth.ssoconfig.md +0 -1
  168. package/docs/api-report.md +175 -76
  169. package/package.json +12 -13
  170. package/dist/dts/utils/sso.d.ts +0 -27
  171. package/dist/dts/utils/sso.d.ts.map +0 -1
  172. package/dist/esm/utils/sso.js +0 -50
  173. package/docs/api/foundation-auth.authformentrystore.haserrors.md +0 -11
  174. package/docs/api/foundation-auth.authformentrystore.message.md +0 -11
  175. package/docs/api/foundation-auth.authrouting.getroutepath.md +0 -13
  176. package/docs/api/foundation-auth.authrouting.md +0 -37
  177. package/docs/api/foundation-auth.authrouting.navigateto.md +0 -16
  178. package/docs/api/foundation-auth.defaultauthformentrystore.autofill.md +0 -15
  179. package/docs/api/foundation-auth.defaultauthformentrystore.fetchmachine.md +0 -11
  180. package/docs/api/foundation-auth.defaultauthformentrystore.host.md +0 -11
  181. package/docs/api/foundation-auth.defaultauthformentrystore.resetidpstate.md +0 -15
  182. package/docs/api/foundation-auth.defaultauthformentrystore.ssotoggledchanged.md +0 -23
  183. package/docs/api/foundation-auth.defaultauthrouting.getroutepath.md +0 -24
  184. package/docs/api/foundation-auth.defaultauthrouting.md +0 -22
  185. package/docs/api/foundation-auth.defaultauthrouting.navigateto.md +0 -26
  186. package/docs/api/foundation-auth.fetchidps.md +0 -13
  187. package/docs/api/foundation-auth.fromdtonackerrorwarningarray.md +0 -12
  188. package/docs/api/foundation-auth.getauthrouting.md +0 -32
  189. package/docs/api/foundation-auth.getssologinurl.md +0 -13
  190. package/docs/api/foundation-auth.idpresponse.md +0 -20
  191. package/docs/api/foundation-auth.includeserrorwarningcode.md +0 -13
@@ -9,26 +9,35 @@
9
9
  import { AbstractMachine } from '@genesislcap/foundation-state-machine';
10
10
  import { AbstractStore } from '@genesislcap/foundation-store';
11
11
  import { AbstractStoreRoot } from '@genesislcap/foundation-store';
12
+ import { ActionArgs } from 'xstate';
13
+ import { AnyActorContext } from 'xstate';
14
+ import { AnyState } from 'xstate';
15
+ import { Assigner } from 'xstate';
16
+ import { BindingObserver } from '@microsoft/fast-element';
12
17
  import { ComposableStyles } from '@microsoft/fast-element';
13
18
  import { Constructable } from '@microsoft/fast-element';
14
19
  import { Container } from '@microsoft/fast-foundation';
15
20
  import { Controller } from '@microsoft/fast-element';
16
- import type { DoneInvokeEvent } from 'xstate';
21
+ import { DoneInvokeEvent } from 'xstate';
17
22
  import { ElementStyles } from '@microsoft/fast-element';
18
23
  import { EmitOptions } from '@genesislcap/foundation-events';
19
24
  import { EmitReturn } from '@genesislcap/foundation-events';
20
25
  import type { ErrorEvent as ErrorEvent_2 } from 'xstate';
26
+ import { EventObject } from 'xstate';
21
27
  import { FetchMachine } from '@genesislcap/foundation-state-machine';
22
28
  import { FetchMachineEvent } from '@genesislcap/foundation-state-machine';
23
29
  import { InterfaceSymbol } from '@microsoft/fast-foundation';
24
30
  import type { InterpreterOptions } from 'xstate';
25
31
  import { Key } from '@microsoft/fast-foundation';
26
32
  import { Listener } from '@genesislcap/foundation-utils';
27
- import { Logger } from '@genesislcap/foundation-utils';
33
+ import { Logger } from '@genesislcap/foundation-logger';
28
34
  import { Machine } from '@genesislcap/foundation-state-machine';
29
35
  import type { MachineContext } from '@genesislcap/foundation-state-machine';
36
+ import { MachineContext as MachineContext_2 } from 'xstate';
30
37
  import { Observer } from '@genesislcap/foundation-utils';
38
+ import { ParameterizedObject } from 'xstate';
31
39
  import { PartialFASTElementDefinition } from '@microsoft/fast-element';
40
+ import { PropertyAssigner } from 'xstate';
32
41
  import { RouterConfiguration } from '@microsoft/fast-router';
33
42
  import { Store } from '@genesislcap/foundation-store';
34
43
  import { StoreRoot } from '@genesislcap/foundation-store';
@@ -103,7 +112,7 @@ export type AuthFormEntryEventMap = {
103
112
  'auth-password-changed': string;
104
113
  'auth-password2-changed': string;
105
114
  'auth-showPasswords-changed': boolean;
106
- 'auth-selectedIDP-changed': string;
115
+ 'auth-selectedIdp-changed': string;
107
116
  'auth-ssoToggled-changed': boolean;
108
117
  };
109
118
 
@@ -116,15 +125,9 @@ export interface AuthFormEntryStore extends Store {
116
125
  // (undocumented)
117
126
  readonly email: string;
118
127
  // (undocumented)
119
- readonly hasErrors: boolean;
120
- // (undocumented)
121
128
  readonly hasPasswordExpired: boolean;
122
129
  // (undocumented)
123
- readonly host: string;
124
- // (undocumented)
125
- readonly idps: IDP[];
126
- // (undocumented)
127
- readonly message: string;
130
+ readonly idps: Idp[];
128
131
  // (undocumented)
129
132
  readonly mfaCode: string;
130
133
  // (undocumented)
@@ -138,7 +141,7 @@ export interface AuthFormEntryStore extends Store {
138
141
  // (undocumented)
139
142
  onPasswordChanged(event: CustomEvent<string>): void;
140
143
  // (undocumented)
141
- onSelectedIDPChanged(event: CustomEvent<string>): void;
144
+ onSelectedIdpChanged(event: CustomEvent<string>): void;
142
145
  // (undocumented)
143
146
  onShowPasswordsChanged(event: CustomEvent<boolean>): void;
144
147
  // (undocumented)
@@ -156,10 +159,12 @@ export interface AuthFormEntryStore extends Store {
156
159
  // (undocumented)
157
160
  readonly passwordResetToken: string;
158
161
  // (undocumented)
159
- readonly selectedIDP: string;
162
+ readonly selectedIdp: Idp;
160
163
  // (undocumented)
161
164
  readonly showPasswords: boolean;
162
165
  // (undocumented)
166
+ readonly ssoLoginUrl: string;
167
+ // (undocumented)
163
168
  readonly ssoToggled: boolean;
164
169
  // (undocumented)
165
170
  readonly termsAgreed: boolean;
@@ -262,30 +267,20 @@ export const AuthRoutes: {
262
267
  // @public (undocumented)
263
268
  export type AuthRoutes = (typeof AuthRoutes)[keyof typeof AuthRoutes];
264
269
 
265
- // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "AuthRouting" because one of its declarations is marked as @internal
266
- //
267
- // @public
268
- export interface AuthRouting {
269
- getRoutePath: typeof getRoutePath;
270
- // Warning: (ae-incompatible-release-tags) The symbol "navigateTo" is marked as @public, but its signature references "navigateTo" which is marked as @internal
271
- //
272
- // (undocumented)
273
- navigateTo: typeof navigateTo;
274
- }
275
-
276
- // @internal
277
- export const AuthRouting: InterfaceSymbol<AuthRouting>;
278
-
279
270
  // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "AuthStore" because one of its declarations is marked as @internal
280
271
  //
281
272
  // @public
282
273
  export interface AuthStore extends StoreRoot {
283
274
  readonly authMachine: AuthMachine;
284
275
  // (undocumented)
276
+ readonly errorMessages: string[];
277
+ // (undocumented)
285
278
  readonly formEntry: AuthFormEntryStore;
286
279
  // (undocumented)
287
280
  readonly isPending: boolean;
288
281
  // (undocumented)
282
+ readonly metaMessages: string[];
283
+ // (undocumented)
289
284
  onChangePassword(event: CustomEvent<ChangePasswordParams>): void;
290
285
  // (undocumented)
291
286
  onForgotPassword(event: CustomEvent<ForgotPasswordParams>): void;
@@ -413,76 +408,125 @@ export const defaultAuthConfig: AuthConfig;
413
408
  // @public
414
409
  export class DefaultAuthFormEntryStore extends AbstractStore<AuthFormEntryStore, AuthFormEntryEventMap, InternalEventMap> implements AuthFormEntryStore {
415
410
  constructor();
416
- // (undocumented)
411
+ // @internal (undocumented)
417
412
  protected autofill(): Promise<boolean>;
413
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
414
+ //
418
415
  // (undocumented)
419
416
  autofilling: boolean;
420
417
  // (undocumented)
421
418
  protected config: AuthConfig;
422
419
  // (undocumented)
423
420
  protected credentialManager: CredentialManager;
421
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
422
+ //
424
423
  // (undocumented)
425
424
  email: string;
426
- // (undocumented)
427
- readonly fetchMachine: FetchMachine;
428
- // (undocumented)
429
- hasErrors: boolean;
425
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
426
+ //
430
427
  // (undocumented)
431
428
  hasPasswordExpired: boolean;
429
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
430
+ //
432
431
  // (undocumented)
433
- host: string;
434
- // (undocumented)
435
- idps: IDP[];
432
+ idps: Idp[];
433
+ // Warning: (ae-forgotten-export) The symbol "IDPService" needs to be exported by the entry point index.d.ts
434
+ //
436
435
  // (undocumented)
437
- message: string;
436
+ readonly idpService: IDPService;
437
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
438
+ //
438
439
  // (undocumented)
439
440
  mfaCode: string;
441
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
442
+ //
440
443
  // (undocumented)
441
444
  onAutofillForm: EventListener;
445
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
446
+ //
442
447
  // (undocumented)
443
448
  onEmailChanged: EventListener;
449
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
450
+ //
444
451
  // (undocumented)
445
452
  onOrganisationChanged: EventListener;
453
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
454
+ //
446
455
  // (undocumented)
447
456
  onPassword2Changed: EventListener;
457
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
458
+ //
448
459
  // (undocumented)
449
460
  onPasswordChanged: EventListener;
461
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
462
+ //
450
463
  // (undocumented)
451
- onSelectedIDPChanged: EventListener;
464
+ onSelectedIdpChanged: EventListener;
465
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
466
+ //
452
467
  // (undocumented)
453
468
  onShowPasswordsChanged: EventListener;
469
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
470
+ //
454
471
  // (undocumented)
455
472
  onSSOToggleChanged: EventListener;
473
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
474
+ //
456
475
  // (undocumented)
457
476
  onUsernameChanged: EventListener;
477
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
478
+ //
458
479
  // (undocumented)
459
480
  organisation: string;
481
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
482
+ //
460
483
  // (undocumented)
461
484
  get orgUsername(): string;
485
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
486
+ //
462
487
  // (undocumented)
463
488
  password: string;
489
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
490
+ //
464
491
  // (undocumented)
465
492
  password2: string;
493
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
494
+ //
466
495
  // (undocumented)
467
496
  passwordResetToken: string;
468
- // (undocumented)
497
+ // @internal (undocumented)
469
498
  protected resetIDPState(): void;
499
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
500
+ //
470
501
  // (undocumented)
471
- selectedIDP: string;
502
+ selectedIdp: Idp;
503
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
504
+ //
472
505
  // (undocumented)
473
506
  showPasswords: boolean;
507
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
508
+ //
474
509
  // (undocumented)
475
- ssoToggled: boolean;
510
+ get ssoLoginUrl(): string;
511
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
512
+ //
476
513
  // (undocumented)
477
- protected ssoToggledChanged(prev: boolean, next: boolean): void;
514
+ ssoToggled: boolean;
515
+ // @internal (undocumented)
516
+ protected ssoToggledChanged: (prev: boolean, next: boolean) => Promise<void>;
517
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
518
+ //
478
519
  // (undocumented)
479
520
  termsAgreed: boolean;
521
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthFormEntryStore" has more than one declaration; you need to add a TSDoc member reference selector
522
+ //
480
523
  // (undocumented)
481
524
  username: string;
482
525
  }
483
526
 
484
527
  // @public
485
528
  export class DefaultAuthMachine extends AbstractMachine<AuthMachineContext, AuthMachineEvent> implements AuthMachine {
529
+ // Warning: (ae-forgotten-export) The symbol "AuthRouting" needs to be exported by the entry point index.d.ts
486
530
  constructor(user: User, fetchMachine: FetchMachine, cm: CredentialManager, uuid: UUID, messageMapper: AuthMessageMapper, config: AuthConfig, routing: AuthRouting);
487
531
  // (undocumented)
488
532
  protected captureAuthQueryParams(): QueryParams;
@@ -490,12 +534,12 @@ export class DefaultAuthMachine extends AbstractMachine<AuthMachineContext, Auth
490
534
  protected convertQueryParamsToLoginParams(params: QueryParams): LoginParams;
491
535
  // (undocumented)
492
536
  protected createFetchMachineEvent(url: string, msg?: {}): FetchMachineEvent;
493
- getFromContainer(): this;
494
537
  // (undocumented)
495
- protected onDoneDTO: () => {
538
+ protected dtoTransition: () => {
496
539
  actions: string[];
497
540
  target: string;
498
541
  };
542
+ getFromContainer(): this;
499
543
  // (undocumented)
500
544
  protected onIdleEvents: () => {
501
545
  login: {
@@ -533,18 +577,6 @@ export class DefaultAuthMessageMapper extends DefaultMessageMapper<AuthMessageMa
533
577
  protected passwordMapper: PasswordManagementMapper;
534
578
  }
535
579
 
536
- // @public
537
- export class DefaultAuthRouting implements AuthRouting {
538
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthRouting" has more than one declaration; you need to add a TSDoc member reference selector
539
- //
540
- // (undocumented)
541
- getRoutePath(route: AuthRoutes | string): string;
542
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthRouting" has more than one declaration; you need to add a TSDoc member reference selector
543
- //
544
- // (undocumented)
545
- navigateTo(route: AuthRoutes | string): void;
546
- }
547
-
548
580
  // Warning: (ae-forgotten-export) The symbol "InternalAuthEventMap" needs to be exported by the entry point index.d.ts
549
581
  //
550
582
  // @public
@@ -554,20 +586,42 @@ export class DefaultAuthStore extends AbstractStoreRoot<AuthStore, AuthEventMap,
554
586
  readonly authMachine: AuthMachine;
555
587
  // (undocumented)
556
588
  readonly config: AuthConfig;
589
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
590
+ //
591
+ // (undocumented)
592
+ get errorMessages(): string[];
557
593
  // (undocumented)
558
594
  readonly formEntry: AuthFormEntryStore;
595
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
596
+ //
559
597
  // (undocumented)
560
598
  get isPending(): boolean;
599
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
600
+ //
601
+ // (undocumented)
602
+ get metaMessages(): string[];
603
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
604
+ //
561
605
  // (undocumented)
562
606
  onChangePassword: EventListener;
607
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
608
+ //
563
609
  // (undocumented)
564
610
  onForgotPassword: EventListener;
611
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
612
+ //
565
613
  // (undocumented)
566
614
  onLogin: EventListener;
615
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
616
+ //
567
617
  // (undocumented)
568
618
  onLogout: EventListener;
619
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
620
+ //
569
621
  // (undocumented)
570
622
  onMachineEvent: EventListener;
623
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "AuthStore" has more than one declaration; you need to add a TSDoc member reference selector
624
+ //
571
625
  // (undocumented)
572
626
  onResetPassword: EventListener;
573
627
  }
@@ -870,9 +924,6 @@ export interface EVENT_SELF_SERVICE_PASSWORD_RESET extends MESSAGE {
870
924
  readonly USER_NAME: string;
871
925
  }
872
926
 
873
- // @public
874
- export const fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>;
875
-
876
927
  // @public
877
928
  export type FieldConfig = {
878
929
  label: string;
@@ -904,9 +955,15 @@ export type ForgotPasswordParams = {
904
955
  //
905
956
  // @public
906
957
  export class FoundationAuth extends FoundationAuth_base {
958
+ // @internal (undocumented)
959
+ protected addBindings(): void;
907
960
  // @internal (undocumented)
908
961
  protected addEventListeners(): void;
909
962
  // @internal (undocumented)
963
+ attemptAutofill(): void;
964
+ // @internal (undocumented)
965
+ get classNames(): string;
966
+ // @internal (undocumented)
910
967
  config: AuthRouterConfig;
911
968
  // @internal (undocumented)
912
969
  connectedCallback(): void;
@@ -917,13 +974,19 @@ export class FoundationAuth extends FoundationAuth_base {
917
974
  // @internal (undocumented)
918
975
  get isReady(): boolean;
919
976
  // @internal (undocumented)
977
+ protected machineBinding: BindingObserver;
978
+ // @internal (undocumented)
920
979
  protected readyStore(): void;
921
980
  // @internal (undocumented)
922
981
  protected registerDIDependencies(): void;
923
982
  // @internal (undocumented)
983
+ protected removeBindings(): void;
984
+ // @internal (undocumented)
924
985
  protected removeEventListeners(): void;
925
986
  // @internal (undocumented)
926
987
  store: AuthStore;
988
+ // @internal (undocumented)
989
+ template(): ViewTemplate<FoundationAuth, any>;
927
990
  }
928
991
 
929
992
  // Warning: (ae-incompatible-release-tags) The symbol "fromDTOAck" is marked as @public, but its signature references "ACK" which is marked as @internal
@@ -938,26 +1001,22 @@ export const fromDTOAck: (dto: ACK) => Ack;
938
1001
  // @public
939
1002
  export const fromDTONack: (dto: NACK) => Nack;
940
1003
 
941
- // Warning: (ae-incompatible-release-tags) The symbol "fromDTONackErrorWarningArray" is marked as @public, but its signature references "NACK_ERROR_WARNING" which is marked as @internal
942
- // Warning: (ae-incompatible-release-tags) The symbol "fromDTONackErrorWarningArray" is marked as @public, but its signature references "NackErrorWarning" which is marked as @internal
943
- //
944
- // @public (undocumented)
945
- export const fromDTONackErrorWarningArray: (arr: NACK_ERROR_WARNING[]) => NackErrorWarning[];
946
-
947
1004
  // @public (undocumented)
948
1005
  export const fromDTOStringArray: (arr: string[]) => string[];
949
1006
 
950
1007
  // @public
951
- export function getAuthRouting(): AuthRouting;
1008
+ export const fromIDPDTO: (dto: IDP) => Idp;
952
1009
 
953
1010
  // @public
954
1011
  export type GetCredentialOptions = CredentialRequestOptions & {};
955
1012
 
956
- // @public
957
- export function getRoutePath(route: AuthRoutes | string, hostPath?: string): string;
1013
+ // Warning: (ae-internal-missing-underscore) The name "getNormalisedText" should be prefixed with an underscore because the declaration is marked as @internal
1014
+ //
1015
+ // @internal
1016
+ export const getNormalisedText: (arr: NackErrorWarning[]) => string;
958
1017
 
959
1018
  // @public
960
- export const getSSOLoginURL: (idp: any, path?: string, host?: string) => string;
1019
+ export function getRoutePath(route: AuthRoutes | string, hostPath?: string): string;
961
1020
 
962
1021
  // @public
963
1022
  export function getUser(): User;
@@ -970,23 +1029,25 @@ export const hasDTOErrorWarningCode: (dto: NACK, code: string) => boolean;
970
1029
  // @public (undocumented)
971
1030
  export interface IDP {
972
1031
  // (undocumented)
973
- id: string;
1032
+ readonly DESCRIPTION: string;
974
1033
  // (undocumented)
975
- type: string;
1034
+ readonly ID: string;
1035
+ // (undocumented)
1036
+ readonly TYPE: string;
976
1037
  }
977
1038
 
978
1039
  // @public (undocumented)
979
- export interface IDPResponse {
1040
+ export interface Idp {
980
1041
  // (undocumented)
981
- ID: string;
1042
+ readonly description: string;
982
1043
  // (undocumented)
983
- TYPE: string;
1044
+ readonly id: string;
1045
+ // (undocumented)
1046
+ readonly type: string;
984
1047
  }
985
1048
 
986
- // Warning: (ae-incompatible-release-tags) The symbol "includesErrorWarningCode" is marked as @public, but its signature references "NACK_ERROR_WARNING" which is marked as @internal
987
- //
988
1049
  // @public
989
- export const includesErrorWarningCode: (arr: NACK_ERROR_WARNING[], code: string) => boolean;
1050
+ export const is200Nack: <TOutput = any>(event: EventObject | DoneInvokeEvent<TOutput>) => event is DoneInvokeEvent<TOutput>;
990
1051
 
991
1052
  // @public
992
1053
  export function isChangePasswordParams(params: AuthMachineEventParams): params is ChangePasswordParams;
@@ -1038,6 +1099,11 @@ export function isMFRoute(pathname?: string): boolean;
1038
1099
  // @public
1039
1100
  export function isNackDTO(dto: unknown): dto is NACK;
1040
1101
 
1102
+ // Warning: (ae-incompatible-release-tags) The symbol "isNackEntity" is marked as @public, but its signature references "Nack" which is marked as @internal
1103
+ //
1104
+ // @public
1105
+ export function isNackEntity(entity: unknown): entity is Nack;
1106
+
1041
1107
  // @public
1042
1108
  export function isQueryParams(params: AuthMachineEventParams): params is QueryParams;
1043
1109
 
@@ -1051,6 +1117,9 @@ export type JWTCredentials = {
1051
1117
  domain: string;
1052
1118
  };
1053
1119
 
1120
+ // @public (undocumented)
1121
+ export const loadingTemplate: ViewTemplate<FoundationAuth, any>;
1122
+
1054
1123
  // @public (undocumented)
1055
1124
  export const logger: Logger;
1056
1125
 
@@ -1112,11 +1181,15 @@ export const LoginMapper: InterfaceSymbol<LoginMapper>;
1112
1181
  //
1113
1182
  // @public (undocumented)
1114
1183
  export interface LoginNack extends Nack {
1184
+ // (undocumented)
1185
+ readonly hasIncorrectCredentials: boolean;
1115
1186
  // (undocumented)
1116
1187
  readonly hasPasswordExpired: boolean;
1117
1188
  // (undocumented)
1118
1189
  readonly isMFARequired: boolean;
1119
1190
  // (undocumented)
1191
+ readonly maxTriesReached: boolean;
1192
+ // (undocumented)
1120
1193
  readonly refreshAuthToken: string;
1121
1194
  }
1122
1195
 
@@ -1251,6 +1324,14 @@ export interface Nack extends Message {
1251
1324
  // (undocumented)
1252
1325
  readonly error: NackErrorWarning[];
1253
1326
  // (undocumented)
1327
+ readonly normalisedErrorStatusCode: number;
1328
+ // (undocumented)
1329
+ readonly normalisedErrorText: string;
1330
+ // (undocumented)
1331
+ readonly normalisedWarningStatusCode: number;
1332
+ // (undocumented)
1333
+ readonly normalisedWarningText: string;
1334
+ // (undocumented)
1254
1335
  readonly warning: NackErrorWarning[];
1255
1336
  }
1256
1337
 
@@ -1334,6 +1415,19 @@ export type ResetPasswordParams = {
1334
1415
  requester?: string;
1335
1416
  };
1336
1417
 
1418
+ // @public (undocumented)
1419
+ export const routerTemplate: ViewTemplate<FoundationAuth, any>;
1420
+
1421
+ // @public
1422
+ export const setError: {
1423
+ (_: ActionArgs<MachineContext_2, EventObject, ParameterizedObject>): void;
1424
+ type: string;
1425
+ assignment: Assigner<MachineContext_2, EventObject> | PropertyAssigner<MachineContext_2, EventObject>;
1426
+ resolve: (actorContext: AnyActorContext, state: AnyState, actionArgs: ActionArgs<any, any, ParameterizedObject>, { assignment }: {
1427
+ assignment: Assigner<any, any> | PropertyAssigner<any, any>;
1428
+ }) => AnyState[];
1429
+ };
1430
+
1337
1431
  // @public
1338
1432
  export type Settings = {
1339
1433
  public?: boolean;
@@ -1342,10 +1436,15 @@ export type Settings = {
1342
1436
  // @public (undocumented)
1343
1437
  export let SOCKET_URL: string;
1344
1438
 
1439
+ // @public (undocumented)
1440
+ export let SSO_LIST_URL: string;
1441
+
1442
+ // @public (undocumented)
1443
+ export let SSO_LOGIN_URL: string;
1444
+
1345
1445
  // @public (undocumented)
1346
1446
  export type SSOConfig = {
1347
1447
  toggled?: boolean;
1348
- identityProvidersPath: string;
1349
1448
  };
1350
1449
 
1351
1450
  // @public (undocumented)
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-auth",
3
3
  "description": "Genesis Foundation Auth",
4
- "version": "14.71.1-auth-mf.21",
4
+ "version": "14.99.0-auth-mf.22",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-auth.d.ts",
8
8
  "config": {
9
- "we still keeping these": "discuss?",
10
9
  "PORT": 5030
11
10
  },
12
11
  "genx": {
@@ -99,18 +98,19 @@
99
98
  }
100
99
  },
101
100
  "devDependencies": {
102
- "@genesislcap/foundation-testing": "14.71.1-auth-mf.21",
103
- "@genesislcap/genx": "14.71.1-auth-mf.21",
101
+ "@genesislcap/foundation-testing": "14.99.0-auth-mf.22",
102
+ "@genesislcap/genx": "14.99.0-auth-mf.22",
104
103
  "rimraf": "^3.0.2"
105
104
  },
106
105
  "dependencies": {
107
- "@genesislcap/foundation-comms": "14.71.1-auth-mf.21",
108
- "@genesislcap/foundation-events": "14.71.1-auth-mf.21",
109
- "@genesislcap/foundation-state-machine": "14.71.1-auth-mf.21",
110
- "@genesislcap/foundation-store": "14.71.1-auth-mf.21",
111
- "@genesislcap/foundation-ui": "14.71.1-auth-mf.21",
112
- "@genesislcap/foundation-utils": "14.71.1-auth-mf.21",
113
- "@genesislcap/foundation-zero": "14.71.1-auth-mf.21",
106
+ "@genesislcap/foundation-comms": "14.99.0-auth-mf.22",
107
+ "@genesislcap/foundation-events": "14.99.0-auth-mf.22",
108
+ "@genesislcap/foundation-logger": "14.99.0-auth-mf.22",
109
+ "@genesislcap/foundation-state-machine": "14.99.0-auth-mf.22",
110
+ "@genesislcap/foundation-store": "14.99.0-auth-mf.22",
111
+ "@genesislcap/foundation-ui": "14.99.0-auth-mf.22",
112
+ "@genesislcap/foundation-utils": "14.99.0-auth-mf.22",
113
+ "@genesislcap/foundation-zero": "14.99.0-auth-mf.22",
114
114
  "@microsoft/fast-components": "^2.21.3",
115
115
  "@microsoft/fast-element": "^1.7.0",
116
116
  "@microsoft/fast-foundation": "^2.33.2",
@@ -130,6 +130,5 @@
130
130
  "publishConfig": {
131
131
  "access": "public"
132
132
  },
133
- "customElements": "dist/custom-elements.json",
134
- "gitHead": "58a5860a945b1f1c770ec1e6d1187faf1df2d453"
133
+ "gitHead": "cb81909dc515cd5abba01a24199954836bbbf68b"
135
134
  }
@@ -1,27 +0,0 @@
1
- /**
2
- * Get SSO identity provider login URL
3
- *
4
- * @public
5
- */
6
- export declare const getSSOLoginURL: (idp: any, path?: string, host?: string) => string;
7
- /**
8
- * @public
9
- */
10
- export interface IDP {
11
- id: string;
12
- type: string;
13
- }
14
- /**
15
- * @public
16
- */
17
- export interface IDPResponse {
18
- ID: string;
19
- TYPE: string;
20
- }
21
- /**
22
- * Request SSO identity provider list
23
- *
24
- * @public
25
- */
26
- export declare const fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>;
27
- //# sourceMappingURL=sso.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../../../src/utils/sso.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,eAAO,MAAM,cAAc,oDAK1B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,oCAA+C,QAAQ,GAAG,EAAE,CAkBjF,CAAC"}
@@ -1,50 +0,0 @@
1
- import { __awaiter } from "tslib";
2
- import { API_HOST } from '@genesislcap/foundation-utils';
3
- import { logger } from './logger';
4
- /**
5
- * @internal
6
- */
7
- const getAPIHostHTTPURL = (host = API_HOST, includePath = false) => {
8
- const url = new URL(host);
9
- const protocol = url.protocol.replace('ws', 'http');
10
- const path = includePath ? url.pathname : '';
11
- return `${protocol}//${url.host}${path}`;
12
- };
13
- /**
14
- * @internal
15
- */
16
- const getIPDEndpoint = (path, host) => `${getAPIHostHTTPURL(host)}/${path}`;
17
- /**
18
- * Get SSO identity provider login URL
19
- *
20
- * @public
21
- */
22
- export const getSSOLoginURL = (idp, path = '/login?idp=', host = API_HOST) => {
23
- if (!idp || !idp.type || !idp.id) {
24
- throw new Error(`Invalid IDP: ${JSON.stringify(idp)}`);
25
- }
26
- return `${getAPIHostHTTPURL(host, true)}${idp.type}${path}${idp.id}`;
27
- };
28
- /**
29
- * Request SSO identity provider list
30
- *
31
- * @public
32
- */
33
- export const fetchIDPs = (path = 'sso/list', host = API_HOST) => __awaiter(void 0, void 0, void 0, function* () {
34
- const IDP_ENDPOINT = getIPDEndpoint(path, host);
35
- return fetch(IDP_ENDPOINT)
36
- .then((res) => {
37
- if (res.ok)
38
- return res;
39
- throw new Error(res.statusText);
40
- })
41
- .then((res) => res.json())
42
- .then(({ IDPS = [] }) => IDPS.map((idp) => ({
43
- id: idp.ID,
44
- type: idp.TYPE,
45
- })))
46
- .catch(() => {
47
- logger.error('Failed to fetch identity providers.');
48
- return [{ id: 'error', type: null, description: 'Failed to fetch providers.' }];
49
- });
50
- });