@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
@@ -12,10 +12,14 @@ export const ResetPasswordTemplate = html `
12
12
  <auth-logo></auth-logo>
13
13
  ${showEnvironmentIndicator()}
14
14
  <div class="heading2" data-test-id="heading">${(x) => x.headingText}</div>
15
- <div class="heading3">${(x) => x.toLocalisedText('RESET_PASSWORD_SUBTITLE')}</div>
15
+ <div class="heading3">
16
+ ${(x) => x.toLocalisedText(x.showIdentityFields ? 'RESET_PASSWORD_SUBTITLE' : 'RESET_PASSWORD_TOKEN_SUBTITLE')}
17
+ </div>
16
18
  </div>
17
19
  <form @submit=${(x) => x.onSubmit()} autocomplete="on" data-test-id="form">
18
- ${organisationField()} ${usernameField()}
20
+ ${when((x) => x.showIdentityFields, html `
21
+ ${organisationField()} ${usernameField()}
22
+ `)}
19
23
  ${when((x) => !x.passwordResetToken, html `
20
24
  ${(x) => passwordField(x.toLocalisedText(x.hasPasswordExpired
21
25
  ? 'RESET_PASSWORD_CURRENT_PASSWORD_FIELD'
@@ -26,6 +26,7 @@
26
26
  "REQUEST_ACCOUNT_SUBMIT_BUTTON": "Request Account",
27
27
  "REQUEST_ACCOUNT_BUTTON_BACK": "Back",
28
28
  "RESET_PASSWORD_SUBTITLE": "Enter the username registered to your account",
29
+ "RESET_PASSWORD_TOKEN_SUBTITLE": "Enter a new password for your account",
29
30
  "RESET_PASSWORD_OLD_PASSWORD_FIELD": "Old Password",
30
31
  "RESET_PASSWORD_CURRENT_PASSWORD_FIELD": "Current Password",
31
32
  "RESET_PASSWORD_SUBMIT_BUTTON": "Change Password",
@@ -2179,7 +2179,7 @@
2179
2179
  },
2180
2180
  {
2181
2181
  "kind": "Content",
2182
- "text": ";\n} | {\n type: 'logout';\n} | {\n type: 'cancel-mfa';\n} | {\n type: 'change-password';\n params: "
2182
+ "text": ";\n} | {\n type: 'logout';\n} | {\n type: 'cancel-mfa';\n} | {\n type: 'dismiss';\n} | {\n type: 'change-password';\n params: "
2183
2183
  },
2184
2184
  {
2185
2185
  "kind": "Reference",
@@ -3283,6 +3283,89 @@
3283
3283
  "endIndex": 2
3284
3284
  }
3285
3285
  },
3286
+ {
3287
+ "kind": "Function",
3288
+ "canonicalReference": "@genesislcap/foundation-auth!clearAuthErrorState:function(1)",
3289
+ "docComment": "/**\n * Drop accumulated machine errors. `ErrorMap` is shared with `startingContext`, so reset must clear it in place rather than replacing the context object.\n *\n * @public\n */\n",
3290
+ "excerptTokens": [
3291
+ {
3292
+ "kind": "Content",
3293
+ "text": "export declare function clearAuthErrorState<T extends "
3294
+ },
3295
+ {
3296
+ "kind": "Reference",
3297
+ "text": "ErrorState",
3298
+ "canonicalReference": "@genesislcap/foundation-auth!~ErrorState:type"
3299
+ },
3300
+ {
3301
+ "kind": "Content",
3302
+ "text": ">(context: "
3303
+ },
3304
+ {
3305
+ "kind": "Content",
3306
+ "text": "T"
3307
+ },
3308
+ {
3309
+ "kind": "Content",
3310
+ "text": ", starting?: "
3311
+ },
3312
+ {
3313
+ "kind": "Content",
3314
+ "text": "T"
3315
+ },
3316
+ {
3317
+ "kind": "Content",
3318
+ "text": "): "
3319
+ },
3320
+ {
3321
+ "kind": "Content",
3322
+ "text": "T"
3323
+ },
3324
+ {
3325
+ "kind": "Content",
3326
+ "text": ";"
3327
+ }
3328
+ ],
3329
+ "fileUrlPath": "src/machine/actions.ts",
3330
+ "returnTypeTokenRange": {
3331
+ "startIndex": 7,
3332
+ "endIndex": 8
3333
+ },
3334
+ "releaseTag": "Public",
3335
+ "overloadIndex": 1,
3336
+ "parameters": [
3337
+ {
3338
+ "parameterName": "context",
3339
+ "parameterTypeTokenRange": {
3340
+ "startIndex": 3,
3341
+ "endIndex": 4
3342
+ },
3343
+ "isOptional": false
3344
+ },
3345
+ {
3346
+ "parameterName": "starting",
3347
+ "parameterTypeTokenRange": {
3348
+ "startIndex": 5,
3349
+ "endIndex": 6
3350
+ },
3351
+ "isOptional": true
3352
+ }
3353
+ ],
3354
+ "typeParameters": [
3355
+ {
3356
+ "typeParameterName": "T",
3357
+ "constraintTokenRange": {
3358
+ "startIndex": 1,
3359
+ "endIndex": 2
3360
+ },
3361
+ "defaultTypeTokenRange": {
3362
+ "startIndex": 0,
3363
+ "endIndex": 0
3364
+ }
3365
+ }
3366
+ ],
3367
+ "name": "clearAuthErrorState"
3368
+ },
3286
3369
  {
3287
3370
  "kind": "Function",
3288
3371
  "canonicalReference": "@genesislcap/foundation-auth!configure:function(1)",
@@ -6068,7 +6151,7 @@
6068
6151
  },
6069
6152
  {
6070
6153
  "kind": "Content",
6071
- "text": "() => {\n login: {\n actions: string[];\n target: string;\n };\n \"terms-and-conditions\": {\n actions: string[];\n target: string;\n };\n \"forgot-password\": {\n actions: string[];\n target: string;\n };\n \"change-password\": {\n actions: string[];\n target: string;\n };\n \"reset-password\": {\n actions: string[];\n target: string;\n };\n }"
6154
+ "text": "() => {\n login: {\n actions: string[];\n target: string;\n };\n \"terms-and-conditions\": {\n actions: string[];\n target: string;\n };\n \"forgot-password\": {\n actions: string[];\n target: string;\n };\n \"change-password\": {\n actions: string[];\n target: string;\n };\n \"reset-password\": {\n actions: string[];\n target: string;\n };\n dismiss: {\n actions: string[];\n target: string;\n };\n }"
6072
6155
  },
6073
6156
  {
6074
6157
  "kind": "Content",
@@ -10006,6 +10089,51 @@
10006
10089
  ],
10007
10090
  "name": "getRoutePath"
10008
10091
  },
10092
+ {
10093
+ "kind": "Function",
10094
+ "canonicalReference": "@genesislcap/foundation-auth!hasDTOErrors:function(1)",
10095
+ "docComment": "/**\n * True when a Genesis payload contains at least one ERROR item.\n *\n * @public\n */\n",
10096
+ "excerptTokens": [
10097
+ {
10098
+ "kind": "Content",
10099
+ "text": "export declare function hasDTOErrors(dto: "
10100
+ },
10101
+ {
10102
+ "kind": "Content",
10103
+ "text": "unknown"
10104
+ },
10105
+ {
10106
+ "kind": "Content",
10107
+ "text": "): "
10108
+ },
10109
+ {
10110
+ "kind": "Content",
10111
+ "text": "boolean"
10112
+ },
10113
+ {
10114
+ "kind": "Content",
10115
+ "text": ";"
10116
+ }
10117
+ ],
10118
+ "fileUrlPath": "src/mapper/utils.ts",
10119
+ "returnTypeTokenRange": {
10120
+ "startIndex": 3,
10121
+ "endIndex": 4
10122
+ },
10123
+ "releaseTag": "Public",
10124
+ "overloadIndex": 1,
10125
+ "parameters": [
10126
+ {
10127
+ "parameterName": "dto",
10128
+ "parameterTypeTokenRange": {
10129
+ "startIndex": 1,
10130
+ "endIndex": 2
10131
+ },
10132
+ "isOptional": false
10133
+ }
10134
+ ],
10135
+ "name": "hasDTOErrors"
10136
+ },
10009
10137
  {
10010
10138
  "kind": "Function",
10011
10139
  "canonicalReference": "@genesislcap/foundation-auth!hasDTOErrorWarningCode:function(1)",
@@ -10408,6 +10536,51 @@
10408
10536
  ],
10409
10537
  "name": "isChangePasswordParams"
10410
10538
  },
10539
+ {
10540
+ "kind": "Function",
10541
+ "canonicalReference": "@genesislcap/foundation-auth!isFailedAuthDTO:function(1)",
10542
+ "docComment": "/**\n * True when a Genesis payload must be treated as failure. HTTP status is intentionally ignored; MESSAGE_TYPE and ERROR are the contract.\n *\n * @public\n */\n",
10543
+ "excerptTokens": [
10544
+ {
10545
+ "kind": "Content",
10546
+ "text": "export declare function isFailedAuthDTO(dto: "
10547
+ },
10548
+ {
10549
+ "kind": "Content",
10550
+ "text": "unknown"
10551
+ },
10552
+ {
10553
+ "kind": "Content",
10554
+ "text": "): "
10555
+ },
10556
+ {
10557
+ "kind": "Content",
10558
+ "text": "boolean"
10559
+ },
10560
+ {
10561
+ "kind": "Content",
10562
+ "text": ";"
10563
+ }
10564
+ ],
10565
+ "fileUrlPath": "src/mapper/utils.ts",
10566
+ "returnTypeTokenRange": {
10567
+ "startIndex": 3,
10568
+ "endIndex": 4
10569
+ },
10570
+ "releaseTag": "Public",
10571
+ "overloadIndex": 1,
10572
+ "parameters": [
10573
+ {
10574
+ "parameterName": "dto",
10575
+ "parameterTypeTokenRange": {
10576
+ "startIndex": 1,
10577
+ "endIndex": 2
10578
+ },
10579
+ "isOptional": false
10580
+ }
10581
+ ],
10582
+ "name": "isFailedAuthDTO"
10583
+ },
10411
10584
  {
10412
10585
  "kind": "Function",
10413
10586
  "canonicalReference": "@genesislcap/foundation-auth!isForgotPasswordParams:function(1)",
@@ -438,6 +438,8 @@ export declare type AuthMachineEvent = {
438
438
  type: 'logout';
439
439
  } | {
440
440
  type: 'cancel-mfa';
441
+ } | {
442
+ type: 'dismiss';
441
443
  } | {
442
444
  type: 'change-password';
443
445
  params: ChangePasswordParams;
@@ -639,6 +641,13 @@ export declare type ChangePasswordParams = {
639
641
  requester?: string;
640
642
  };
641
643
 
644
+ /**
645
+ * Drop accumulated machine errors. `ErrorMap` is shared with `startingContext`, so
646
+ * reset must clear it in place rather than replacing the context object.
647
+ * @public
648
+ */
649
+ export declare function clearAuthErrorState<T extends ErrorState>(context: T, starting?: T): T;
650
+
642
651
  /**
643
652
  * configure.
644
653
  *
@@ -1031,6 +1040,10 @@ export declare class DefaultAuthMachine extends AbstractMachine<AuthMachineConte
1031
1040
  actions: string[];
1032
1041
  target: string;
1033
1042
  };
1043
+ dismiss: {
1044
+ actions: string[];
1045
+ target: string;
1046
+ };
1034
1047
  };
1035
1048
  protected dtoTransition: () => {
1036
1049
  actions: string[];
@@ -1237,6 +1250,13 @@ declare interface Details_2 {
1237
1250
  readonly PRODUCT: Product_2[];
1238
1251
  }
1239
1252
 
1253
+ declare type ErrorState = {
1254
+ error?: unknown;
1255
+ errors?: {
1256
+ clear(): void;
1257
+ };
1258
+ };
1259
+
1240
1260
  /**
1241
1261
  * @public
1242
1262
  */
@@ -1951,6 +1971,12 @@ export declare function getRoutePath(route: AuthRoutes | string, hostPath?: stri
1951
1971
 
1952
1972
  export { getUser }
1953
1973
 
1974
+ /**
1975
+ * True when a Genesis payload contains at least one ERROR item.
1976
+ * @public
1977
+ */
1978
+ export declare function hasDTOErrors(dto: unknown): boolean;
1979
+
1954
1980
  /**
1955
1981
  * hasDTOErrorWarningCode
1956
1982
  * @remarks
@@ -2012,7 +2038,8 @@ declare type InternalEventMap = {
2012
2038
  /**
2013
2039
  * is200Nack.
2014
2040
  * @privateRemarks
2015
- * Required until http status codes are aligned on backend.
2041
+ * Required until http status codes are aligned on backend. HTTP status is ignored;
2042
+ * Genesis MESSAGE_TYPE / ERROR determine failure.
2016
2043
  * @public
2017
2044
  */
2018
2045
  export declare const is200Nack: <TOutput = any>(event: EventObject | DoneInvokeEvent<TOutput>) => event is DoneInvokeEvent<TOutput>;
@@ -2026,6 +2053,13 @@ export declare const is200Nack: <TOutput = any>(event: EventObject | DoneInvokeE
2026
2053
  */
2027
2054
  export declare function isChangePasswordParams(params: AuthMachineEventParams): params is ChangePasswordParams;
2028
2055
 
2056
+ /**
2057
+ * True when a Genesis payload must be treated as failure.
2058
+ * HTTP status is intentionally ignored; MESSAGE_TYPE and ERROR are the contract.
2059
+ * @public
2060
+ */
2061
+ export declare function isFailedAuthDTO(dto: unknown): boolean;
2062
+
2029
2063
  /**
2030
2064
  * isForgotPasswordParams.
2031
2065
  * @remarks
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-auth",
3
3
  "description": "Genesis Foundation Auth",
4
- "version": "15.14.1",
4
+ "version": "15.14.2-FUI-2603.2",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-auth.d.ts",
@@ -134,25 +134,25 @@
134
134
  }
135
135
  },
136
136
  "devDependencies": {
137
- "@genesislcap/foundation-testing": "15.14.1",
138
- "@genesislcap/genx": "15.14.1",
139
- "@genesislcap/rollup-builder": "15.14.1",
140
- "@genesislcap/ts-builder": "15.14.1",
141
- "@genesislcap/uvu-playwright-builder": "15.14.1",
142
- "@genesislcap/vite-builder": "15.14.1",
143
- "@genesislcap/webpack-builder": "15.14.1"
137
+ "@genesislcap/foundation-testing": "15.14.2-FUI-2603.2",
138
+ "@genesislcap/genx": "15.14.2-FUI-2603.2",
139
+ "@genesislcap/rollup-builder": "15.14.2-FUI-2603.2",
140
+ "@genesislcap/ts-builder": "15.14.2-FUI-2603.2",
141
+ "@genesislcap/uvu-playwright-builder": "15.14.2-FUI-2603.2",
142
+ "@genesislcap/vite-builder": "15.14.2-FUI-2603.2",
143
+ "@genesislcap/webpack-builder": "15.14.2-FUI-2603.2"
144
144
  },
145
145
  "dependencies": {
146
- "@genesislcap/foundation-comms": "15.14.1",
147
- "@genesislcap/foundation-events": "15.14.1",
148
- "@genesislcap/foundation-i18n": "15.14.1",
149
- "@genesislcap/foundation-logger": "15.14.1",
150
- "@genesislcap/foundation-state-machine": "15.14.1",
151
- "@genesislcap/foundation-store": "15.14.1",
152
- "@genesislcap/foundation-ui": "15.14.1",
153
- "@genesislcap/foundation-user": "15.14.1",
154
- "@genesislcap/foundation-utils": "15.14.1",
155
- "@genesislcap/foundation-zero": "15.14.1",
146
+ "@genesislcap/foundation-comms": "15.14.2-FUI-2603.2",
147
+ "@genesislcap/foundation-events": "15.14.2-FUI-2603.2",
148
+ "@genesislcap/foundation-i18n": "15.14.2-FUI-2603.2",
149
+ "@genesislcap/foundation-logger": "15.14.2-FUI-2603.2",
150
+ "@genesislcap/foundation-state-machine": "15.14.2-FUI-2603.2",
151
+ "@genesislcap/foundation-store": "15.14.2-FUI-2603.2",
152
+ "@genesislcap/foundation-ui": "15.14.2-FUI-2603.2",
153
+ "@genesislcap/foundation-user": "15.14.2-FUI-2603.2",
154
+ "@genesislcap/foundation-utils": "15.14.2-FUI-2603.2",
155
+ "@genesislcap/foundation-zero": "15.14.2-FUI-2603.2",
156
156
  "@microsoft/fast-components": "2.30.6",
157
157
  "@microsoft/fast-element": "1.14.0",
158
158
  "@microsoft/fast-foundation": "2.50.0",
@@ -173,5 +173,5 @@
173
173
  "access": "public"
174
174
  },
175
175
  "customElements": "dist/custom-elements.json",
176
- "gitHead": "466a79ef9cc4520eb29533fe22058c8d39e59ab5"
176
+ "gitHead": "470d546163b507cfe4bc8335cdb5955c40aeb58a"
177
177
  }