@genesislcap/foundation-auth 15.14.1 → 15.14.2-FUI-2603.2

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 (52) hide show
  1. package/dist/dts/machine/actions.d.ts +13 -0
  2. package/dist/dts/machine/actions.d.ts.map +1 -1
  3. package/dist/dts/machine/actions.test.d.ts +2 -0
  4. package/dist/dts/machine/actions.test.d.ts.map +1 -0
  5. package/dist/dts/machine/dto.d.ts +34 -0
  6. package/dist/dts/machine/dto.d.ts.map +1 -0
  7. package/dist/dts/machine/dto.test.d.ts +2 -0
  8. package/dist/dts/machine/dto.test.d.ts.map +1 -0
  9. package/dist/dts/machine/errors.d.ts +5 -0
  10. package/dist/dts/machine/errors.d.ts.map +1 -1
  11. package/dist/dts/machine/guards.d.ts +2 -1
  12. package/dist/dts/machine/guards.d.ts.map +1 -1
  13. package/dist/dts/machine/guards.test.d.ts +2 -0
  14. package/dist/dts/machine/guards.test.d.ts.map +1 -0
  15. package/dist/dts/machine/machine.d.ts +4 -0
  16. package/dist/dts/machine/machine.d.ts.map +1 -1
  17. package/dist/dts/machine/types.d.ts +2 -0
  18. package/dist/dts/machine/types.d.ts.map +1 -1
  19. package/dist/dts/mapper/utils.d.ts +11 -0
  20. package/dist/dts/mapper/utils.d.ts.map +1 -1
  21. package/dist/dts/mapper/utils.test.d.ts +2 -0
  22. package/dist/dts/mapper/utils.test.d.ts.map +1 -0
  23. package/dist/dts/routes/base.d.ts +6 -0
  24. package/dist/dts/routes/base.d.ts.map +1 -1
  25. package/dist/dts/routes/forgot-password/forgot-password.d.ts.map +1 -1
  26. package/dist/dts/routes/reset-password/reset-identity.d.ts +38 -0
  27. package/dist/dts/routes/reset-password/reset-identity.d.ts.map +1 -0
  28. package/dist/dts/routes/reset-password/reset-identity.test.d.ts +2 -0
  29. package/dist/dts/routes/reset-password/reset-identity.test.d.ts.map +1 -0
  30. package/dist/dts/routes/reset-password/reset-password.d.ts +2 -0
  31. package/dist/dts/routes/reset-password/reset-password.d.ts.map +1 -1
  32. package/dist/dts/routes/reset-password/reset-password.template.d.ts.map +1 -1
  33. package/dist/esm/machine/actions.js +16 -6
  34. package/dist/esm/machine/actions.test.js +21 -0
  35. package/dist/esm/machine/dto.js +76 -0
  36. package/dist/esm/machine/dto.test.js +88 -0
  37. package/dist/esm/machine/errors.js +39 -8
  38. package/dist/esm/machine/guards.js +13 -5
  39. package/dist/esm/machine/guards.test.js +53 -0
  40. package/dist/esm/machine/machine.js +107 -45
  41. package/dist/esm/mapper/utils.js +16 -0
  42. package/dist/esm/mapper/utils.test.js +56 -0
  43. package/dist/esm/routes/base.js +21 -1
  44. package/dist/esm/routes/forgot-password/forgot-password.js +5 -0
  45. package/dist/esm/routes/reset-password/reset-identity.js +99 -0
  46. package/dist/esm/routes/reset-password/reset-identity.test.js +55 -0
  47. package/dist/esm/routes/reset-password/reset-password.js +22 -0
  48. package/dist/esm/routes/reset-password/reset-password.template.js +6 -2
  49. package/dist/esm/translation.json +1 -0
  50. package/dist/foundation-auth.api.json +175 -2
  51. package/dist/foundation-auth.d.ts +35 -1
  52. package/package.json +19 -19
@@ -1,3 +1,15 @@
1
+ type ErrorState = {
2
+ error?: unknown;
3
+ errors?: {
4
+ clear(): void;
5
+ };
6
+ };
7
+ /**
8
+ * Drop accumulated machine errors. `ErrorMap` is shared with `startingContext`, so
9
+ * reset must clear it in place rather than replacing the context object.
10
+ * @public
11
+ */
12
+ export declare function clearAuthErrorState<T extends ErrorState>(context: T, starting?: T): T;
1
13
  /**
2
14
  * Set error action.
3
15
  * @remarks
@@ -12,4 +24,5 @@ export declare const setError: {
12
24
  assignment: import("xstate").Assigner<any, any> | import("xstate").PropertyAssigner<any, any>;
13
25
  }) => import("xstate").AnyState[];
14
26
  };
27
+ export {};
15
28
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/machine/actions.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;CAYnB,CAAC"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/machine/actions.ts"],"names":[],"mappings":"AAKA,KAAK,UAAU,GAAG;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE;QAAE,KAAK,IAAI,IAAI,CAAA;KAAE,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAOrF;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;CAYnB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=actions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.test.d.ts","sourceRoot":"","sources":["../../../src/machine/actions.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ import type { EventObject } from 'xstate';
2
+ import type { CredentialData } from '../credential';
3
+ /**
4
+ * Unwrap a Genesis auth DTO from FetchMachine output or APIError.
5
+ * @public
6
+ */
7
+ export declare function unwrapAuthDto(value: unknown): unknown;
8
+ type AuthMachineEventLike = EventObject & {
9
+ data?: unknown;
10
+ error?: unknown;
11
+ output?: unknown;
12
+ };
13
+ /**
14
+ * Read the auth DTO from a fetch done/error event.
15
+ * @public
16
+ */
17
+ export declare function authDtoFromMachineEvent(event: AuthMachineEventLike): unknown;
18
+ /**
19
+ * True when a fetch done/error event carries a Genesis NACK / ERROR payload.
20
+ * @public
21
+ */
22
+ export declare function isAuthNackEvent(event: AuthMachineEventLike): boolean;
23
+ /**
24
+ * True when fetch completed in the failed final state without a Genesis NACK body.
25
+ * @public
26
+ */
27
+ export declare function isFetchFailureOutput(event: AuthMachineEventLike): boolean;
28
+ /**
29
+ * Fire-and-forget credential persistence so xstate does not hold pending on the Promise.
30
+ * @public
31
+ */
32
+ export declare function persistCredentials(store: (data: CredentialData) => Promise<unknown> | unknown, data: CredentialData): void;
33
+ export {};
34
+ //# sourceMappingURL=dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../../src/machine/dto.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAMpD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAcrD;AAED,KAAK,oBAAoB,GAAG,WAAW,GAAG;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAMF;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAQ5E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAEpE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CASzE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,EAC3D,IAAI,EAAE,cAAc,GACnB,IAAI,CASN"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dto.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dto.test.d.ts","sourceRoot":"","sources":["../../../src/machine/dto.test.ts"],"names":[],"mappings":""}
@@ -23,4 +23,9 @@ export declare class NackError extends APIError {
23
23
  */
24
24
  static fromEntity(entity: Nack): NackError | null;
25
25
  }
26
+ /**
27
+ * Build a {@link NackError} from a fetch/API/NACK payload.
28
+ * @public
29
+ */
30
+ export declare function nackErrorFromUnknown(value: unknown): NackError | null;
26
31
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/machine/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAU,SAAQ,QAAQ;IAE5B,MAAM,EAAE,MAAM;IACd,IAAI,CAAC,EAAE,OAAO;gBADd,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,OAAO,EACrB,OAAO,GAAE,MAA6B;IAKxC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI;CAmBlD"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/machine/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,uCAAuC,CAAC;AAE7E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGtC;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAU,SAAQ,QAAQ;IAE5B,MAAM,EAAE,MAAM;IACd,IAAI,CAAC,EAAE,OAAO;gBADd,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,OAAO,EACrB,OAAO,GAAE,MAA6B;IAKxC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI;CAwBlD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAuBrE"}
@@ -2,7 +2,8 @@ import { DoneInvokeEvent, EventObject } from 'xstate';
2
2
  /**
3
3
  * is200Nack.
4
4
  * @privateRemarks
5
- * Required until http status codes are aligned on backend.
5
+ * Required until http status codes are aligned on backend. HTTP status is ignored;
6
+ * Genesis MESSAGE_TYPE / ERROR determine failure.
6
7
  * @public
7
8
  */
8
9
  export declare const is200Nack: <TOutput = any>(event: EventObject | DoneInvokeEvent<TOutput>) => event is DoneInvokeEvent<TOutput>;
@@ -1 +1 @@
1
- {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/machine/guards.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGtD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,GAAG,GAAG,EACrC,OAAO,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,KAC5C,KAAK,IAAI,eAAe,CAAC,OAAO,CAGxB,CAAC"}
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/machine/guards.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGtD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,GAAG,GAAG,EACrC,OAAO,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,KAC5C,KAAK,IAAI,eAAe,CAAC,OAAO,CAWlC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=guards.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.test.d.ts","sourceRoot":"","sources":["../../../src/machine/guards.test.ts"],"names":[],"mappings":""}
@@ -55,6 +55,10 @@ export declare class DefaultAuthMachine extends AbstractMachine<AuthMachineConte
55
55
  actions: string[];
56
56
  target: string;
57
57
  };
58
+ dismiss: {
59
+ actions: string[];
60
+ target: string;
61
+ };
58
62
  };
59
63
  protected dtoTransition: () => {
60
64
  actions: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"machine.d.ts","sourceRoot":"","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AW;IAGd,OAAO,CAAC,IAAI;IACJ,OAAO,CAAC,YAAY;IACf,OAAO,CAAC,EAAE;IACvB,OAAO,CAAC,IAAI;IACC,OAAO,CAAC,aAAa;IAC5B,OAAO,CAAC,MAAM;IACb,OAAO,CAAC,OAAO;gBANd,IAAI,EAAE,IAAI,EACF,YAAY,EAAE,YAAY,EACrB,EAAE,EAAE,iBAAiB,EAClC,IAAI,EAAE,IAAI,EACG,aAAa,EAAE,iBAAiB,EACvC,MAAM,EAAE,UAAU,EACjB,OAAO,EAAE,WAAW;IA4sB3C,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;IAuB3E,SAAS,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,iBAAiB;IAgB3E,SAAS,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;MA4BpB;IAEF,SAAS,CAAC,aAAa;;;MAGpB;CACJ;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,mEAA0E,CAAC;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
@@ -99,6 +99,8 @@ export type AuthMachineEvent = {
99
99
  type: 'logout';
100
100
  } | {
101
101
  type: 'cancel-mfa';
102
+ } | {
103
+ type: 'dismiss';
102
104
  } | {
103
105
  type: 'change-password';
104
106
  params: ChangePasswordParams;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/machine/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAA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AI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,oBAAoB,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,GACD;IACE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,MAAM,EAAE,qBAAqB,CAAC;CAC/B,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;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IAAI,oBAAoB,CAGhC;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IAAI,oBAAoB,CAGhC;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IAAI,mBAAmB,CAG/B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,IAAI,WAAW,CAGnF"}
@@ -44,6 +44,17 @@ export declare const fromIDPDTO: (dto: IDENTITY_PROVIDER) => IdentityProvider;
44
44
  * @public
45
45
  */
46
46
  export declare function isNackDTO(dto: unknown): dto is NACK;
47
+ /**
48
+ * True when a Genesis payload contains at least one ERROR item.
49
+ * @public
50
+ */
51
+ export declare function hasDTOErrors(dto: unknown): boolean;
52
+ /**
53
+ * True when a Genesis payload must be treated as failure.
54
+ * HTTP status is intentionally ignored; MESSAGE_TYPE and ERROR are the contract.
55
+ * @public
56
+ */
57
+ export declare function isFailedAuthDTO(dto: unknown): boolean;
47
58
  /**
48
59
  * isNackEntity.
49
60
  * @param entity - Potential Nack.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/mapper/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAsB,MAAM,QAAQ,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,EAAE,KAAG,MAAM,EACN,CAAC;AA0CpD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,gBAAgB,EAAE,KAAG,MACyB,CAAC;AAEtF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,IAAI,EAAE,MAAM,MAAM,YAI7D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,GAAG,KAAG,GAGpC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,IAAI,KAAG,IAavC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,iBAAiB,KAAG,gBAMnD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,IAAI,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,IAAI,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,EACD,WAAW,GAAE,MAA0C,GACtD,WAAW,C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AW,GAAE,MAA0C,GACtD,WAAW,CAWb"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../src/mapper/utils.test.ts"],"names":[],"mappings":""}
@@ -404,6 +404,12 @@ export declare class BaseRoute extends ConfigHostElement {
404
404
  user: User;
405
405
  store: AuthStore;
406
406
  routing: AuthRouting;
407
+ connectedCallback(): void;
408
+ /**
409
+ * Skip dismiss while a request or MFA challenge is in flight so route
410
+ * (re)connect does not cancel the current auth step.
411
+ */
412
+ protected get shouldDismissOnConnect(): boolean;
407
413
  onBack: () => void;
408
414
  toLocalisedText(text: string): string;
409
415
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/routes/base.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAGpD,OAAO,EAEL,OAAO,EAQR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,KAAK,QAAQ,GAAG,YAAY,GAAG,qBAAqB,GAAG,EAAE,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,SAAS,yKAAiC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,UAAU,yKAAkC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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S,OAAO,EAAE,OAAO,MAAM,2DAU/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,UAAU,EAC/C,OAAO,MAAM,EACb,aAAY,MAAiB,EAC7B,WAAU,OAAe,2DAW1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,SAAS,6DAO3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/forgot-password/forgot-password.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC;;;;;;;;GAQG;AACH,qBAKa,cAAe,SAAQ,SAAS;IACrC,QAAQ;CAUf"}
1
+ {"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/forgot-password/forgot-password.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC;;;;;;;;GAQG;AACH,qBAKa,cAAe,SAAQ,SAAS;IACrC,QAAQ;CAcf"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Identity captured during forgot-password so the token reset screen can
3
+ * submit USER_NAME without asking the user to type it again.
4
+ */
5
+ export declare const RESET_IDENTITY_STORAGE_KEY = "foundation-auth:password-reset-identity";
6
+ /**
7
+ * @public
8
+ */
9
+ export type ResetIdentity = {
10
+ username: string;
11
+ organisation?: string;
12
+ };
13
+ type QueryParams = Record<string, string | undefined>;
14
+ /**
15
+ * @public
16
+ */
17
+ export declare function persistResetIdentity(identity: ResetIdentity, storage?: Storage): void;
18
+ /**
19
+ * @public
20
+ */
21
+ export declare function readResetIdentity(storage?: Storage): ResetIdentity | undefined;
22
+ /**
23
+ * @public
24
+ */
25
+ export declare function clearResetIdentity(storage?: Storage): void;
26
+ /**
27
+ * @public
28
+ */
29
+ export declare function resolveResetUsername(queryParams?: QueryParams, stored?: ResetIdentity): string;
30
+ /**
31
+ * Username is required by EVENT_PASSWORD_RESET_ACTION. Hide it only when a
32
+ * reset token is present and the username is already known.
33
+ *
34
+ * @public
35
+ */
36
+ export declare function shouldShowIdentityFields(passwordResetToken: string, username: string): boolean;
37
+ export {};
38
+ //# sourceMappingURL=reset-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-identity.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-identity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,0BAA0B,4CAA4C,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAatD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAmBrF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAqB9E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAU1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,GAAE,WAAgB,EAC7B,MAAM,CAAC,EAAE,aAAa,GACrB,MAAM,CAQR;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE9F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reset-identity.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-identity.test.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-identity.test.ts"],"names":[],"mappings":""}
@@ -19,7 +19,9 @@ export declare class ResetPassword extends BaseRoute {
19
19
  hasPasswordExpired: boolean;
20
20
  passwordResetToken: string;
21
21
  enter(phase: NavigationPhase<Settings>): void;
22
+ private applyResetIdentity;
22
23
  onSubmit(): Promise<void>;
23
24
  get headingText(): "Change Password" | "You are required to change your password";
25
+ get showIdentityFields(): boolean;
24
26
  }
25
27
  //# sourceMappingURL=reset-password.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC;;;;;;;;;;;;;GAaG;AACH,qBAKa,aAAc,SAAQ,SAAS;IAC9B,kBAAkB,EAAE,OAAO,CAAS;IACpC,kBAAkB,EAAE,MAAM,CAAM;IAE5C,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;IAKhC,QAAQ;IAwBd,IACI,WAAW,mEAEd;CACF"}
1
+ {"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAQzC;;;;;;;;;;;;;GAaG;AACH,qBAKa,aAAc,SAAQ,SAAS;IAC9B,kBAAkB,EAAE,OAAO,CAAS;IACpC,kBAAkB,EAAE,MAAM,CAAM;IAE5C,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;IAMtC,OAAO,CAAC,kBAAkB;IAmBpB,QAAQ;IAwBd,IACI,WAAW,mEAEd;IAED,IACI,kBAAkB,YAErB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.template.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,oEAoCjC,CAAC"}
1
+ {"version":3,"file":"reset-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.template.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,oEA8CjC,CAAC"}
@@ -1,8 +1,17 @@
1
- import { isErrorEvent } from '@genesislcap/foundation-state-machine';
1
+ import { isDoneInvokeEvent, isErrorEvent } from '@genesislcap/foundation-state-machine';
2
2
  import { assign } from 'xstate';
3
3
  import { logger } from '../utils';
4
- import { NackError } from './errors';
5
- import { is200Nack } from './guards';
4
+ import { nackErrorFromUnknown } from './errors';
5
+ /**
6
+ * Drop accumulated machine errors. `ErrorMap` is shared with `startingContext`, so
7
+ * reset must clear it in place rather than replacing the context object.
8
+ * @public
9
+ */
10
+ export function clearAuthErrorState(context, starting) {
11
+ var _a, _b;
12
+ (_a = context.errors) === null || _a === void 0 ? void 0 : _a.clear();
13
+ return Object.assign(Object.assign({}, (starting !== null && starting !== void 0 ? starting : context)), { error: undefined, errors: (_b = context.errors) !== null && _b !== void 0 ? _b : starting === null || starting === void 0 ? void 0 : starting.errors });
14
+ }
6
15
  /**
7
16
  * Set error action.
8
17
  * @remarks
@@ -10,15 +19,16 @@ import { is200Nack } from './guards';
10
19
  * @public
11
20
  */
12
21
  export const setError = assign(({ event }) => {
22
+ var _a, _b;
13
23
  if (isErrorEvent(event)) {
14
24
  return {
15
- error: event.data,
25
+ error: (_a = nackErrorFromUnknown(event.data)) !== null && _a !== void 0 ? _a : event.data,
16
26
  };
17
27
  }
18
- if (is200Nack(event)) {
28
+ if (isDoneInvokeEvent(event)) {
19
29
  logger.debug(`setError action called with non error event type.`, event);
20
30
  return {
21
- error: NackError.fromEntity(event.output),
31
+ error: (_b = nackErrorFromUnknown(event.output)) !== null && _b !== void 0 ? _b : event.output,
22
32
  };
23
33
  }
24
34
  });
@@ -0,0 +1,21 @@
1
+ import { assert, createLogicSuite } from '@genesislcap/foundation-testing';
2
+ import { createErrorMap } from '@genesislcap/foundation-utils';
3
+ import { clearAuthErrorState } from './actions';
4
+ const Suite = createLogicSuite('clearAuthErrorState');
5
+ Suite('clears shared ErrorMap in place so startingContext does not keep stale errors', () => {
6
+ const errors = createErrorMap(() => { });
7
+ errors.set('reset-password-error', new Error('Password validation failed'));
8
+ errors.set('silent-login-error', new Error('ERROR_SILENT_LOGIN'));
9
+ const starting = { errors, error: undefined, params: undefined };
10
+ const context = { errors, error: new Error('stale'), params: { username: 'Jane' } };
11
+ const next = clearAuthErrorState(context, starting);
12
+ assert.is(errors.size, 0);
13
+ assert.is(next.error, undefined);
14
+ assert.is(next.errors, errors);
15
+ assert.is(next.params, undefined);
16
+ });
17
+ Suite('does not throw when errors is missing', () => {
18
+ const next = clearAuthErrorState({ error: new Error('x') });
19
+ assert.is(next.error, undefined);
20
+ });
21
+ Suite.run();
@@ -0,0 +1,76 @@
1
+ import { isAPIError, isDoneInvokeEvent, isErrorCustomEvent, isErrorEvent, } from '@genesislcap/foundation-state-machine';
2
+ import { isFailedAuthDTO } from '../mapper/utils';
3
+ const hasMessageType = (value) => typeof value === 'object' && value !== null && 'MESSAGE_TYPE' in value;
4
+ /**
5
+ * Unwrap a Genesis auth DTO from FetchMachine output or APIError.
6
+ * @public
7
+ */
8
+ export function unwrapAuthDto(value) {
9
+ if (value == null) {
10
+ return undefined;
11
+ }
12
+ if (isAPIError(value)) {
13
+ return unwrapAuthDto(value.data);
14
+ }
15
+ if (hasMessageType(value)) {
16
+ return value;
17
+ }
18
+ if (typeof value === 'object' && 'data' in value) {
19
+ return unwrapAuthDto(value.data);
20
+ }
21
+ return undefined;
22
+ }
23
+ function eventErrorPayload(event) {
24
+ var _a, _b;
25
+ return (_b = (_a = event.data) !== null && _a !== void 0 ? _a : event.error) !== null && _b !== void 0 ? _b : event.output;
26
+ }
27
+ /**
28
+ * Read the auth DTO from a fetch done/error event.
29
+ * @public
30
+ */
31
+ export function authDtoFromMachineEvent(event) {
32
+ var _a;
33
+ if (isDoneInvokeEvent(event)) {
34
+ return unwrapAuthDto(event.output);
35
+ }
36
+ if (isErrorEvent(event) || isErrorCustomEvent(event)) {
37
+ return unwrapAuthDto(eventErrorPayload(event));
38
+ }
39
+ return unwrapAuthDto((_a = eventErrorPayload(event)) !== null && _a !== void 0 ? _a : event);
40
+ }
41
+ /**
42
+ * True when a fetch done/error event carries a Genesis NACK / ERROR payload.
43
+ * @public
44
+ */
45
+ export function isAuthNackEvent(event) {
46
+ return isFailedAuthDTO(authDtoFromMachineEvent(event));
47
+ }
48
+ /**
49
+ * True when fetch completed in the failed final state without a Genesis NACK body.
50
+ * @public
51
+ */
52
+ export function isFetchFailureOutput(event) {
53
+ if (!isDoneInvokeEvent(event)) {
54
+ return false;
55
+ }
56
+ const output = event.output;
57
+ if ((output === null || output === void 0 ? void 0 : output.error) == null) {
58
+ return false;
59
+ }
60
+ return !isAuthNackEvent(event);
61
+ }
62
+ /**
63
+ * Fire-and-forget credential persistence so xstate does not hold pending on the Promise.
64
+ * @public
65
+ */
66
+ export function persistCredentials(store, data) {
67
+ try {
68
+ const result = store(data);
69
+ if (result && typeof result.then === 'function') {
70
+ void result.catch(() => undefined);
71
+ }
72
+ }
73
+ catch (_a) {
74
+ // Credential storage is best-effort.
75
+ }
76
+ }
@@ -0,0 +1,88 @@
1
+ import { __awaiter } from "tslib";
2
+ import { APIError } from '@genesislcap/foundation-state-machine';
3
+ import { assert, createLogicSuite } from '@genesislcap/foundation-testing';
4
+ import { StatusCodes } from 'http-status-codes';
5
+ import { authDtoFromMachineEvent, isAuthNackEvent, isFetchFailureOutput, persistCredentials, unwrapAuthDto, } from './dto';
6
+ const Suite = createLogicSuite('authDtoFromMachineEvent');
7
+ const mfaNack = {
8
+ ERROR: [
9
+ {
10
+ '@type': 'LoginError',
11
+ CODE: 'MFA_REQUIRED',
12
+ TEXT: 'Problem logging in',
13
+ STATUS_CODE: '403 Forbidden',
14
+ },
15
+ ],
16
+ WARNING: [],
17
+ MESSAGE_TYPE: 'EVENT_LOGIN_AUTH_NACK',
18
+ SOURCE_REF: 'ref',
19
+ };
20
+ const eventAck = {
21
+ MESSAGE_TYPE: 'EVENT_ACK',
22
+ SOURCE_REF: 'ack-ref',
23
+ };
24
+ Suite('unwraps DTO from FetchMachineOutput', () => {
25
+ const dto = unwrapAuthDto({ data: mfaNack, response: { ok: false } });
26
+ assert.is(dto.MESSAGE_TYPE, 'EVENT_LOGIN_AUTH_NACK');
27
+ });
28
+ Suite('unwraps DTO from APIError', () => {
29
+ const dto = unwrapAuthDto(new APIError(StatusCodes.FORBIDDEN, mfaNack));
30
+ assert.is(dto.MESSAGE_TYPE, 'EVENT_LOGIN_AUTH_NACK');
31
+ });
32
+ Suite('treats HTTP 403 MFA NACK as auth nack on error.platform', () => {
33
+ assert.ok(isAuthNackEvent({
34
+ type: 'error.platform.loginFetcher',
35
+ data: new APIError(StatusCodes.FORBIDDEN, mfaNack),
36
+ }));
37
+ });
38
+ Suite('treats HTTP 403 MFA NACK as auth nack on done.invoke wrapping APIError', () => {
39
+ assert.ok(isAuthNackEvent({
40
+ type: 'done.invoke.loginFetcher',
41
+ output: new APIError(StatusCodes.FORBIDDEN, mfaNack),
42
+ }));
43
+ });
44
+ Suite('does not treat EVENT_ACK as nack', () => {
45
+ assert.not.ok(isAuthNackEvent({
46
+ type: 'done.invoke.resetPasswordFetcher',
47
+ output: { data: eventAck, response: { ok: true } },
48
+ }));
49
+ assert.is(authDtoFromMachineEvent({
50
+ type: 'done.invoke.resetPasswordFetcher',
51
+ output: { data: eventAck, response: { ok: true } },
52
+ }).MESSAGE_TYPE, 'EVENT_ACK');
53
+ });
54
+ Suite('unwraps DTO from xstate error payload on error field', () => {
55
+ assert.ok(isAuthNackEvent({
56
+ type: 'xstate.error.actor.0',
57
+ error: new APIError(StatusCodes.FORBIDDEN, mfaNack),
58
+ }));
59
+ });
60
+ Suite('does not treat HTTP 403 MFA NACK as a generic fetch failure', () => {
61
+ assert.not.ok(isFetchFailureOutput({
62
+ type: 'done.invoke.loginFetcher',
63
+ output: {
64
+ data: mfaNack,
65
+ error: new APIError(StatusCodes.FORBIDDEN, mfaNack),
66
+ },
67
+ }));
68
+ });
69
+ Suite('treats network/API failure without NACK as fetch failure', () => {
70
+ assert.ok(isFetchFailureOutput({
71
+ type: 'done.invoke.loginFetcher',
72
+ output: {
73
+ data: undefined,
74
+ error: new APIError(StatusCodes.INTERNAL_SERVER_ERROR),
75
+ },
76
+ }));
77
+ });
78
+ Suite('persistCredentials does not return the storage Promise', () => __awaiter(void 0, void 0, void 0, function* () {
79
+ let stored;
80
+ const result = persistCredentials((data) => new Promise((resolve) => {
81
+ stored = data;
82
+ resolve(true);
83
+ }), { id: 'jane', name: 'jane', password: 'x' });
84
+ assert.is(result, undefined);
85
+ yield Promise.resolve();
86
+ assert.is(stored === null || stored === void 0 ? void 0 : stored.id, 'jane');
87
+ }));
88
+ Suite.run();
@@ -1,4 +1,6 @@
1
- import { APIError } from '@genesislcap/foundation-state-machine';
1
+ import { APIError, isAPIError } from '@genesislcap/foundation-state-machine';
2
+ import { StatusCodes } from 'http-status-codes';
3
+ import { fromDTONack, isNackDTO, isNackEntity } from '../mapper/utils';
2
4
  /**
3
5
  * NackError.
4
6
  *
@@ -26,15 +28,44 @@ export class NackError extends APIError {
26
28
  if (!entity) {
27
29
  return null;
28
30
  }
29
- /**
30
- * Prioritize errors
31
- */
32
- if (entity.normalisedErrorStatusCode > 0) {
33
- return new NackError(entity.normalisedErrorStatusCode, entity, entity.normalisedErrorText);
31
+ if (entity.normalisedErrorText) {
32
+ return new NackError(entity.normalisedErrorStatusCode > 0
33
+ ? entity.normalisedErrorStatusCode
34
+ : StatusCodes.INTERNAL_SERVER_ERROR, entity, entity.normalisedErrorText);
34
35
  }
35
- if (entity.normalisedWarningStatusCode > 0) {
36
- return new NackError(entity.normalisedWarningStatusCode, entity, entity.normalisedWarningText);
36
+ if (entity.normalisedWarningText) {
37
+ return new NackError(entity.normalisedWarningStatusCode > 0
38
+ ? entity.normalisedWarningStatusCode
39
+ : StatusCodes.BAD_REQUEST, entity, entity.normalisedWarningText);
37
40
  }
38
41
  return null;
39
42
  }
40
43
  }
44
+ /**
45
+ * Build a {@link NackError} from a fetch/API/NACK payload.
46
+ * @public
47
+ */
48
+ export function nackErrorFromUnknown(value) {
49
+ if (value == null) {
50
+ return null;
51
+ }
52
+ if (value instanceof NackError) {
53
+ return value;
54
+ }
55
+ if (isAPIError(value)) {
56
+ return nackErrorFromUnknown(value.data);
57
+ }
58
+ if (typeof value === 'object' && value !== null && 'data' in value) {
59
+ const nested = nackErrorFromUnknown(value.data);
60
+ if (nested) {
61
+ return nested;
62
+ }
63
+ }
64
+ if (isNackDTO(value)) {
65
+ return NackError.fromEntity(fromDTONack(value));
66
+ }
67
+ if (isNackEntity(value)) {
68
+ return NackError.fromEntity(value);
69
+ }
70
+ return null;
71
+ }
@@ -1,11 +1,19 @@
1
1
  import { isDoneInvokeEvent } from '@genesislcap/foundation-state-machine';
2
- import { isNackDTO, isNackEntity } from '../mapper';
2
+ import { isFailedAuthDTO, isNackDTO, isNackEntity } from '../mapper/utils';
3
3
  /**
4
4
  * is200Nack.
5
5
  * @privateRemarks
6
- * Required until http status codes are aligned on backend.
6
+ * Required until http status codes are aligned on backend. HTTP status is ignored;
7
+ * Genesis MESSAGE_TYPE / ERROR determine failure.
7
8
  * @public
8
9
  */
9
- export const is200Nack = (event) => isDoneInvokeEvent(event)
10
- ? isNackEntity(event.output) || isNackDTO(event.output)
11
- : false;
10
+ export const is200Nack = (event) => {
11
+ if (!isDoneInvokeEvent(event)) {
12
+ return false;
13
+ }
14
+ const output = event.output;
15
+ return (isNackEntity(output) ||
16
+ isNackDTO(output) ||
17
+ isFailedAuthDTO(output === null || output === void 0 ? void 0 : output.data) ||
18
+ isNackEntity(output === null || output === void 0 ? void 0 : output.data));
19
+ };