@hmcts/opal-frontend-common 0.0.90 → 0.0.91

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 (121) hide show
  1. package/fesm2022/{hmcts-opal-frontend-common-access-denied.component-DNNxndx-.mjs → hmcts-opal-frontend-common-access-denied.component-BCLRLZqh.mjs} +4 -4
  2. package/fesm2022/{hmcts-opal-frontend-common-account-created.component-3MER1dhS.mjs → hmcts-opal-frontend-common-account-created.component-D0g9FjWl.mjs} +4 -4
  3. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-account-summary-base.mjs +3 -3
  4. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-creditor-details-base.mjs +3 -3
  5. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs +3 -3
  6. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs +3 -3
  7. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs +3 -3
  8. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs +3 -3
  9. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-nested-form-base.mjs +3 -3
  10. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs +3 -3
  11. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs +3 -3
  12. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs +3 -3
  13. package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs +3 -3
  14. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs +3 -3
  15. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs +3 -3
  16. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs +3 -3
  17. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs +3 -3
  18. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs +3 -3
  19. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs +3 -3
  20. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs +3 -3
  21. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs +3 -3
  22. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs +3 -3
  23. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs +3 -3
  24. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs +3 -3
  25. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs +3 -3
  26. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs +3 -3
  27. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs +3 -3
  28. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs +3 -3
  29. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs +3 -3
  30. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs +3 -3
  31. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs +3 -3
  32. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs +3 -3
  33. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs +3 -3
  34. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs +12 -12
  35. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs +3 -3
  36. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs +3 -3
  37. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs +3 -3
  38. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs +3 -3
  39. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs +6 -6
  40. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs +3 -3
  41. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs +3 -3
  42. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs +3 -3
  43. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs +3 -3
  44. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs +3 -3
  45. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs +3 -3
  46. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs +3 -3
  47. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs +12 -12
  48. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs +3 -3
  49. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs +6 -6
  50. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs +12 -12
  51. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs +12 -12
  52. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs +3 -3
  53. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.mjs +3 -3
  54. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs +3 -3
  55. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs +3 -3
  56. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs +6 -6
  57. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs +3 -3
  58. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs +3 -3
  59. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs +3 -3
  60. package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs +3 -3
  61. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs +21 -21
  62. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs +3 -3
  63. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs +3 -3
  64. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs +3 -3
  65. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs +3 -3
  66. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs +3 -3
  67. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.mjs +3 -3
  68. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.mjs +3 -3
  69. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs +3 -3
  70. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs +3 -3
  71. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs +3 -3
  72. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs +3 -3
  73. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs +3 -3
  74. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs +6 -6
  75. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-inset-text.mjs +3 -3
  76. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs +3 -3
  77. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs +3 -3
  78. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs +3 -3
  79. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs +6 -6
  80. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs +18 -18
  81. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs +6 -6
  82. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs +3 -3
  83. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs +6 -6
  84. package/fesm2022/{hmcts-opal-frontend-common-concurrency-failure.component-UnC_Qex5.mjs → hmcts-opal-frontend-common-concurrency-failure.component-CdkYMvv-.mjs} +4 -4
  85. package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs +3 -3
  86. package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs +3 -3
  87. package/fesm2022/hmcts-opal-frontend-common-directives-moj-multi-select.mjs +6 -6
  88. package/fesm2022/{hmcts-opal-frontend-common-internal-server-error.component-Cj-ueGWj.mjs → hmcts-opal-frontend-common-internal-server-error.component-CinCBLVo.mjs} +4 -4
  89. package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-DNNxndx-.mjs → hmcts-opal-frontend-common-pages-access-denied.component-BCLRLZqh.mjs} +4 -4
  90. package/fesm2022/{hmcts-opal-frontend-common-pages-account-created.component-3MER1dhS.mjs → hmcts-opal-frontend-common-pages-account-created.component-D0g9FjWl.mjs} +4 -4
  91. package/fesm2022/{hmcts-opal-frontend-common-pages-concurrency-failure.component-UnC_Qex5.mjs → hmcts-opal-frontend-common-pages-concurrency-failure.component-CdkYMvv-.mjs} +4 -4
  92. package/fesm2022/hmcts-opal-frontend-common-pages-dashboard-page.mjs +3 -3
  93. package/fesm2022/{hmcts-opal-frontend-common-pages-internal-server-error.component-Cj-ueGWj.mjs → hmcts-opal-frontend-common-pages-internal-server-error.component-CinCBLVo.mjs} +4 -4
  94. package/fesm2022/{hmcts-opal-frontend-common-pages-permission-denied.component-ClXrjyA5.mjs → hmcts-opal-frontend-common-pages-permission-denied.component-BPb5CZQD.mjs} +4 -4
  95. package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-Cxvc5NV2.mjs → hmcts-opal-frontend-common-pages-sign-in-stub.component-Cnlwqv_f.mjs} +4 -4
  96. package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-dBd0gJTr.mjs → hmcts-opal-frontend-common-pages-sign-in.component-DWLTU9wd.mjs} +4 -4
  97. package/fesm2022/hmcts-opal-frontend-common-pages.mjs +6 -6
  98. package/fesm2022/{hmcts-opal-frontend-common-permission-denied.component-ClXrjyA5.mjs → hmcts-opal-frontend-common-permission-denied.component-BPb5CZQD.mjs} +4 -4
  99. package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs +3 -3
  100. package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs +3 -3
  101. package/fesm2022/hmcts-opal-frontend-common-pipes-monetary.mjs +3 -3
  102. package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs +3 -3
  103. package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs +3 -3
  104. package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs +3 -3
  105. package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs +3 -3
  106. package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs +3 -3
  107. package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs +3 -3
  108. package/fesm2022/hmcts-opal-frontend-common-services-history-transformation-service.mjs +3 -3
  109. package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs +3 -3
  110. package/fesm2022/hmcts-opal-frontend-common-services-opal-user-service.mjs +119 -10
  111. package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs +3 -3
  112. package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs +3 -3
  113. package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs +3 -3
  114. package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs +3 -3
  115. package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs +3 -3
  116. package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs +3 -3
  117. package/fesm2022/{hmcts-opal-frontend-common-sign-in-stub.component-Cxvc5NV2.mjs → hmcts-opal-frontend-common-sign-in-stub.component-Cnlwqv_f.mjs} +4 -4
  118. package/fesm2022/{hmcts-opal-frontend-common-sign-in.component-jf34_3Vv.mjs → hmcts-opal-frontend-common-sign-in.component-DIZlLA6t.mjs} +4 -4
  119. package/fesm2022/hmcts-opal-frontend-common.mjs +6 -6
  120. package/package.json +1 -1
  121. package/types/hmcts-opal-frontend-common-services-opal-user-service.d.ts +56 -4
@@ -35,39 +35,39 @@ const routing = [
35
35
  { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
36
36
  {
37
37
  path: PAGES_ROUTING_PATHS.children.accessDenied,
38
- loadComponent: () => import('./hmcts-opal-frontend-common-access-denied.component-DNNxndx-.mjs').then((c) => c.AccessDeniedComponent),
38
+ loadComponent: () => import('./hmcts-opal-frontend-common-access-denied.component-BCLRLZqh.mjs').then((c) => c.AccessDeniedComponent),
39
39
  canActivate: [authGuard, accountGuard],
40
40
  data: { title: PAGES_ROUTING_TITLES.children.accessDenied },
41
41
  resolve: { title: TitleResolver },
42
42
  },
43
43
  {
44
44
  path: PAGES_ROUTING_PATHS.children.concurrencyFailure,
45
- loadComponent: () => import('./hmcts-opal-frontend-common-concurrency-failure.component-UnC_Qex5.mjs').then((c) => c.ConcurrencyFailureComponent),
45
+ loadComponent: () => import('./hmcts-opal-frontend-common-concurrency-failure.component-CdkYMvv-.mjs').then((c) => c.ConcurrencyFailureComponent),
46
46
  data: { title: PAGES_ROUTING_TITLES.children.concurrencyFailure },
47
47
  resolve: { title: TitleResolver },
48
48
  },
49
49
  {
50
50
  path: PAGES_ROUTING_PATHS.children.permissionDenied,
51
- loadComponent: () => import('./hmcts-opal-frontend-common-permission-denied.component-ClXrjyA5.mjs').then((c) => c.PermissionDeniedComponent),
51
+ loadComponent: () => import('./hmcts-opal-frontend-common-permission-denied.component-BPb5CZQD.mjs').then((c) => c.PermissionDeniedComponent),
52
52
  data: { title: PAGES_ROUTING_TITLES.children.permissionDenied },
53
53
  resolve: { title: TitleResolver },
54
54
  },
55
55
  {
56
56
  path: PAGES_ROUTING_PATHS.children.internalServerError,
57
- loadComponent: () => import('./hmcts-opal-frontend-common-internal-server-error.component-Cj-ueGWj.mjs').then((c) => c.InternalServerErrorComponent),
57
+ loadComponent: () => import('./hmcts-opal-frontend-common-internal-server-error.component-CinCBLVo.mjs').then((c) => c.InternalServerErrorComponent),
58
58
  data: { title: PAGES_ROUTING_TITLES.children.internalServerError },
59
59
  resolve: { title: TitleResolver },
60
60
  },
61
61
  {
62
62
  path: PAGES_ROUTING_PATHS.children.signIn,
63
- loadComponent: () => import('./hmcts-opal-frontend-common-sign-in.component-jf34_3Vv.mjs').then((c) => c.SignInComponent),
63
+ loadComponent: () => import('./hmcts-opal-frontend-common-sign-in.component-DIZlLA6t.mjs').then((c) => c.SignInComponent),
64
64
  canActivate: [signedInGuard],
65
65
  data: { title: PAGES_ROUTING_TITLES.children.signIn },
66
66
  resolve: { title: TitleResolver },
67
67
  },
68
68
  {
69
69
  path: PAGES_ROUTING_PATHS.children.accountCreated,
70
- loadComponent: () => import('./hmcts-opal-frontend-common-account-created.component-3MER1dhS.mjs').then((c) => c.AccountCreated),
70
+ loadComponent: () => import('./hmcts-opal-frontend-common-account-created.component-D0g9FjWl.mjs').then((c) => c.AccountCreated),
71
71
  canActivate: [authGuard],
72
72
  data: { title: PAGES_ROUTING_TITLES.children.accountCreated },
73
73
  resolve: { title: TitleResolver },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmcts/opal-frontend-common",
3
- "version": "0.0.90",
3
+ "version": "0.0.91",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,28 +26,80 @@ interface IOpalUserState {
26
26
  declare class OpalUserService {
27
27
  private readonly http;
28
28
  private readonly globalStore;
29
+ private inFlightUserState$?;
30
+ private userStateRequestGeneration;
31
+ private userStateCacheExpiresAtMilliseconds;
32
+ /**
33
+ * Converts the user-state API status into the service domain status.
34
+ *
35
+ * @param status - The status value returned by the user-state API.
36
+ * @returns The mapped domain status, or null when the API status is null.
37
+ */
29
38
  private toOpalUserStatus;
39
+ /**
40
+ * Gets the configured user-state domain from the global store.
41
+ *
42
+ * @returns The trimmed user-state domain.
43
+ * @throws When no non-blank user-state domain has been configured.
44
+ */
30
45
  private getUserStateDomain;
31
46
  /**
32
47
  * Maps the Redis-backed user state response into the existing domain-specific user state shape.
48
+ *
49
+ * @param userState - The raw user-state API response.
50
+ * @returns The mapped user state for the configured domain.
51
+ * @throws When the response does not include the configured domain.
33
52
  */
34
53
  private toOpalUserState;
54
+ /**
55
+ * Extracts the body from the observed user-state HTTP response.
56
+ *
57
+ * @param response - The full HTTP response from the user-state endpoint.
58
+ * @returns The response body.
59
+ * @throws When the response body is empty.
60
+ */
61
+ private getUserStateResponseBody;
62
+ /**
63
+ * Checks whether a user state can be used as a cached logged-in user.
64
+ *
65
+ * @param userState - The user state currently held in the global store.
66
+ * @returns True when the user state contains a positive numeric user ID.
67
+ */
68
+ private isValidCachedUserState;
69
+ /**
70
+ * Gets the current cached user state when it is populated and unexpired.
71
+ *
72
+ * @returns The cached user state, or null when the cache is empty or expired.
73
+ */
74
+ private getCachedUserState;
75
+ /**
76
+ * Calculates the local cache TTL from the response header and configured maximum TTL.
77
+ *
78
+ * @param response - The full HTTP response from the user-state endpoint.
79
+ * @returns The TTL in milliseconds. A zero response header expires the local cache immediately.
80
+ */
81
+ private getUserStateCacheTtlMilliseconds;
82
+ /**
83
+ * Invalidates local cache controls and marks existing in-flight requests as stale.
84
+ */
85
+ private clearLocalUserStateCache;
35
86
  /**
36
87
  * Retrieves the logged-in user's state as an observable.
37
88
  *
38
- * The frontend user-state endpoint is backed by Redis, so this service does not maintain its own cache.
89
+ * Uses the global store as a local cache until the effective user-state TTL expires, shares concurrent HTTP
90
+ * requests, and ignores stale responses after the local cache has been invalidated.
39
91
  *
40
92
  * @returns {Observable<IOpalUserState>} An observable that emits the logged-in user's state.
41
93
  */
42
94
  getLoggedInUserState(): Observable<IOpalUserState>;
43
95
  /**
44
- * Resets the global store user to an empty object.
96
+ * Clears the global store user state and invalidates local user-state cache controls.
45
97
  *
46
- * Useful for logout/identity switches to avoid reusing stale state.
98
+ * Useful for logout and identity switches to avoid reusing stale state or accepting stale in-flight responses.
47
99
  */
48
100
  clearUserStateCache(): void;
49
101
  /**
50
- * Fetches the latest user state from the Redis-backed frontend endpoint.
102
+ * Fetches the latest user state from the Redis-backed frontend endpoint, bypassing the current local cache.
51
103
  *
52
104
  * @returns An Observable that emits the current {@link IOpalUserState}.
53
105
  */