@salesforce/ui-bundle-template-feature-angular-authentication 12.5.4

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 (295) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +130 -0
  3. package/dist/.forceignore +15 -0
  4. package/dist/.husky/pre-commit +4 -0
  5. package/dist/.prettierignore +11 -0
  6. package/dist/.prettierrc +17 -0
  7. package/dist/CHANGELOG.md +5238 -0
  8. package/dist/README.md +77 -0
  9. package/dist/config/project-scratch-def.json +13 -0
  10. package/dist/eslint.config.js +7 -0
  11. package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls +68 -0
  12. package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls-meta.xml +5 -0
  13. package/dist/force-app/main/default/classes/UIBundleChangePassword.cls +77 -0
  14. package/dist/force-app/main/default/classes/UIBundleChangePassword.cls-meta.xml +5 -0
  15. package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls +71 -0
  16. package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls-meta.xml +5 -0
  17. package/dist/force-app/main/default/classes/UIBundleLogin.cls +105 -0
  18. package/dist/force-app/main/default/classes/UIBundleLogin.cls-meta.xml +5 -0
  19. package/dist/force-app/main/default/classes/UIBundleRegistration.cls +162 -0
  20. package/dist/force-app/main/default/classes/UIBundleRegistration.cls-meta.xml +5 -0
  21. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.forceignore +15 -0
  22. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.graphqlrc.yml +2 -0
  23. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.postcssrc.json +5 -0
  24. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.prettierignore +8 -0
  25. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.prettierrc +12 -0
  26. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/CHANGELOG.md +4 -0
  27. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/README.md +85 -0
  28. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/angular.json +98 -0
  29. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/codegen.yml +95 -0
  30. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/components.json +6 -0
  31. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/e2e/app.spec.ts +15 -0
  32. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/esbuild/api-version.mjs +17 -0
  33. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/esbuild/graphql-codegen.mjs +13 -0
  34. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/eslint-plugin-angular-graphql.js +148 -0
  35. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/eslint.config.js +76 -0
  36. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/feature-angular-authentication.uibundle-meta.xml +7 -0
  37. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/middleware/html.mjs +3 -0
  38. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/middleware/proxy.mjs +12 -0
  39. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/package.json +69 -0
  40. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/playwright.config.ts +25 -0
  41. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/public/favicon.ico +0 -0
  42. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/scripts/get-graphql-schema.mjs +69 -0
  43. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/scripts/rewrite-e2e-assets.mjs +30 -0
  44. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/api/data-client.service.spec.ts +184 -0
  45. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/api/data-client.service.ts +74 -0
  46. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/api/user-profile.service.ts +126 -0
  47. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.config.ts +20 -0
  48. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.html +1 -0
  49. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.routes.ts +66 -0
  50. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.spec.ts +18 -0
  51. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.ts +15 -0
  52. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/layout/app-layout/app-layout.html +51 -0
  53. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/layout/app-layout/app-layout.spec.ts +63 -0
  54. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/layout/app-layout/app-layout.ts +27 -0
  55. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/alert/alert.html +27 -0
  56. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/alert/alert.ts +41 -0
  57. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/button/button.html +27 -0
  58. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/button/button.ts +66 -0
  59. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/card/card.ts +100 -0
  60. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/collapsible/collapsible.html +38 -0
  61. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/collapsible/collapsible.ts +21 -0
  62. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/date-picker/date-picker.html +20 -0
  63. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/date-picker/date-picker.ts +49 -0
  64. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/date-range-picker/date-range-picker.html +20 -0
  65. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/date-range-picker/date-range-picker.ts +69 -0
  66. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/dialog/dialog.html +20 -0
  67. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/dialog/dialog.ts +40 -0
  68. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
  69. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
  70. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/field/field.html +15 -0
  71. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/field/field.ts +28 -0
  72. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/field-appearance.ts +8 -0
  73. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/field-size.ts +8 -0
  74. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/icon/icon.ts +68 -0
  75. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/input/input.html +34 -0
  76. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/input/input.ts +79 -0
  77. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/label/label.ts +21 -0
  78. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/paginator/paginator.html +74 -0
  79. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/paginator/paginator.ts +93 -0
  80. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/paginator/types.ts +13 -0
  81. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/popover/popover.html +13 -0
  82. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/popover/popover.ts +37 -0
  83. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/select/select.html +36 -0
  84. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/select/select.ts +63 -0
  85. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/separator/separator.ts +31 -0
  86. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/skeleton/skeleton.ts +20 -0
  87. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/spinner/spinner.ts +28 -0
  88. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth/auth.guard.ts +50 -0
  89. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth/auth.service.ts +158 -0
  90. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth-form/auth-form.html +33 -0
  91. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth-form/auth-form.ts +94 -0
  92. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth-layout/auth-layout.html +2 -0
  93. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth-layout/auth-layout.ts +30 -0
  94. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/card-layout/card-layout.html +16 -0
  95. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/card-layout/card-layout.ts +40 -0
  96. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/config/authentication.config.ts +75 -0
  97. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/footer-link/footer-link.html +9 -0
  98. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/footer-link/footer-link.ts +26 -0
  99. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/menu/auth-menu/auth-menu.html +36 -0
  100. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/menu/auth-menu/auth-menu.ts +34 -0
  101. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/reactive-form-page.base.ts +50 -0
  102. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/session/session.html +55 -0
  103. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/session/session.ts +205 -0
  104. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/status-alert/status-alert.html +5 -0
  105. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/status-alert/status-alert.ts +52 -0
  106. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/submit-button/submit-button.html +9 -0
  107. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/submit-button/submit-button.ts +23 -0
  108. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/auth-helpers.ts +68 -0
  109. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/auth-validators.ts +72 -0
  110. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/helpers.ts +85 -0
  111. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/session-time-servlet.ts +130 -0
  112. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/session-timeout.config.ts +83 -0
  113. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/session-timeout.service.ts +201 -0
  114. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/change-password/change-password-page.html +68 -0
  115. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/change-password/change-password-page.ts +82 -0
  116. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/forgot-password/forgot-password-page.html +35 -0
  117. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/forgot-password/forgot-password-page.ts +87 -0
  118. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/home/home.html +6 -0
  119. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/home/home.spec.ts +23 -0
  120. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/home/home.ts +13 -0
  121. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/login/login-page.html +47 -0
  122. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/login/login-page.ts +89 -0
  123. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/not-found/not-found.html +12 -0
  124. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/not-found/not-found.spec.ts +33 -0
  125. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/not-found/not-found.ts +15 -0
  126. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/profile/profile-page.html +116 -0
  127. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/profile/profile-page.ts +194 -0
  128. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/register/register-page.html +80 -0
  129. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/register/register-page.ts +93 -0
  130. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/reset-password/reset-password-page.html +60 -0
  131. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/reset-password/reset-password-page.ts +96 -0
  132. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/hlm-alert-action.ts +14 -0
  133. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/hlm-alert-description.ts +17 -0
  134. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/hlm-alert-title.ts +17 -0
  135. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/hlm-alert.ts +35 -0
  136. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/index.ts +16 -0
  137. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/button/hlm-button.token.ts +22 -0
  138. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/button/hlm-button.ts +72 -0
  139. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/button/index.ts +6 -0
  140. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/hlm-calendar-multi.ts +195 -0
  141. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/hlm-calendar-range.ts +194 -0
  142. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/hlm-calendar.ts +189 -0
  143. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/hlm-month-year-calendar.ts +119 -0
  144. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/index.ts +16 -0
  145. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-action.ts +12 -0
  146. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-avatar.ts +14 -0
  147. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-content.ts +12 -0
  148. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-description.ts +12 -0
  149. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-footer.ts +12 -0
  150. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-header.ts +15 -0
  151. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-title.ts +12 -0
  152. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card.token.ts +19 -0
  153. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card.ts +22 -0
  154. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/index.ts +28 -0
  155. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/collapsible/hlm-collapsible-content.ts +14 -0
  156. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/collapsible/hlm-collapsible-trigger.ts +9 -0
  157. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/collapsible/hlm-collapsible.ts +15 -0
  158. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/collapsible/index.ts +13 -0
  159. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-multi-input.ts +104 -0
  160. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-anchor.ts +23 -0
  161. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-input.ts +118 -0
  162. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-multi.token.ts +109 -0
  163. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-multi.ts +220 -0
  164. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-trigger.ts +104 -0
  165. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker.token.ts +69 -0
  166. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker.ts +203 -0
  167. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-range-input.ts +120 -0
  168. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-range-picker.token.ts +86 -0
  169. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-range-picker.ts +252 -0
  170. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-month-year-input.ts +105 -0
  171. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-month-year-picker.token.ts +89 -0
  172. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-month-year-picker.ts +196 -0
  173. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/index.ts +38 -0
  174. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-close.ts +9 -0
  175. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-content.ts +74 -0
  176. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-description.ts +17 -0
  177. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-footer.ts +15 -0
  178. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-header.ts +12 -0
  179. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-overlay.ts +27 -0
  180. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-portal.ts +8 -0
  181. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-title.ts +14 -0
  182. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-trigger.ts +14 -0
  183. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog.service.ts +46 -0
  184. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog.ts +24 -0
  185. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/index.ts +35 -0
  186. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
  187. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox.ts +54 -0
  188. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-focus-on-hover.ts +35 -0
  189. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-group.ts +14 -0
  190. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
  191. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-item.ts +42 -0
  192. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-label.ts +20 -0
  193. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio-indicator.ts +21 -0
  194. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio.ts +49 -0
  195. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-separator.ts +12 -0
  196. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-shortcut.ts +15 -0
  197. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub-trigger.ts +52 -0
  198. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub.ts +53 -0
  199. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-token.ts +26 -0
  200. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-trigger.ts +46 -0
  201. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu.ts +57 -0
  202. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/index.ts +49 -0
  203. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-content.ts +12 -0
  204. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-description.ts +53 -0
  205. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-error.ts +100 -0
  206. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-group.ts +15 -0
  207. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-label.ts +17 -0
  208. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-legend.ts +19 -0
  209. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-separator.ts +24 -0
  210. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-set.ts +15 -0
  211. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-title.ts +15 -0
  212. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field.ts +47 -0
  213. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/index.ts +34 -0
  214. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input/hlm-input.ts +21 -0
  215. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input/index.ts +5 -0
  216. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group-addon.ts +40 -0
  217. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group-button.ts +47 -0
  218. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group-input.ts +17 -0
  219. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group-text.ts +14 -0
  220. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group.ts +18 -0
  221. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/index.ts +19 -0
  222. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/label/hlm-label.ts +17 -0
  223. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/label/index.ts +5 -0
  224. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/label/label.html +11 -0
  225. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-numbered-pagination-query-params.ts +191 -0
  226. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-numbered-pagination.ts +290 -0
  227. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-content.ts +12 -0
  228. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-ellipsis.ts +27 -0
  229. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-item.ts +7 -0
  230. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-link.ts +51 -0
  231. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-next.ts +65 -0
  232. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-previous.ts +65 -0
  233. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination.ts +19 -0
  234. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/index.ts +31 -0
  235. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-content.ts +25 -0
  236. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-description.ts +12 -0
  237. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-header.ts +12 -0
  238. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-portal.ts +8 -0
  239. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-title.ts +12 -0
  240. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-trigger.ts +14 -0
  241. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover.ts +23 -0
  242. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/index.ts +25 -0
  243. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-content.ts +44 -0
  244. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-group.ts +14 -0
  245. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-item.ts +36 -0
  246. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-label.ts +14 -0
  247. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-multiple.ts +37 -0
  248. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-placeholder.ts +17 -0
  249. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-portal.ts +8 -0
  250. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-scroll-down.ts +22 -0
  251. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-scroll-up.ts +22 -0
  252. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-separator.ts +14 -0
  253. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-trigger.ts +59 -0
  254. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-value-template.ts +5 -0
  255. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-value.ts +18 -0
  256. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-values-content.ts +9 -0
  257. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-values.ts +5 -0
  258. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select.ts +37 -0
  259. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/index.ts +52 -0
  260. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/separator/hlm-separator.ts +19 -0
  261. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/separator/index.ts +5 -0
  262. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/skeleton/hlm-skeleton.ts +14 -0
  263. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/skeleton/index.ts +5 -0
  264. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/spinner/hlm-spinner.ts +26 -0
  265. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/spinner/index.ts +5 -0
  266. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/utils/hlm.ts +313 -0
  267. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/utils/index.ts +2 -0
  268. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/utils/provide-spartan-hlm.ts +34 -0
  269. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/utils/async-data.ts +99 -0
  270. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/index.html +13 -0
  271. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/main.ts +5 -0
  272. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/styles.css +139 -0
  273. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/types/sf-globals.d.ts +9 -0
  274. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/tsconfig.app.json +11 -0
  275. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/tsconfig.json +36 -0
  276. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/tsconfig.spec.json +10 -0
  277. package/dist/force-app/main/default/uiBundles/feature-angular-authentication/ui-bundle.json +7 -0
  278. package/dist/jest.config.js +6 -0
  279. package/dist/package-lock.json +12554 -0
  280. package/dist/package.json +46 -0
  281. package/dist/scripts/apex/hello.apex +10 -0
  282. package/dist/scripts/gitignore-templates.json +4 -0
  283. package/dist/scripts/graphql-search.sh +191 -0
  284. package/dist/scripts/org-setup-config-schema.mjs +132 -0
  285. package/dist/scripts/org-setup-dev.mjs +114 -0
  286. package/dist/scripts/org-setup-url.mjs +108 -0
  287. package/dist/scripts/org-setup-utils.mjs +569 -0
  288. package/dist/scripts/org-setup-xml.mjs +278 -0
  289. package/dist/scripts/org-setup.config.json +5 -0
  290. package/dist/scripts/org-setup.mjs +2537 -0
  291. package/dist/scripts/sf-project-setup.mjs +103 -0
  292. package/dist/scripts/soql/account.soql +6 -0
  293. package/dist/scripts/validate-org-setup-config.mjs +38 -0
  294. package/dist/sfdx-project.json +12 -0
  295. package/package.json +45 -0
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /**
8
+ * Error thrown when the API returns a non-OK response with structured error
9
+ * messages. The `errors` array contains user-facing messages that are safe to
10
+ * display — backend Apex classes guarantee that system exceptions are never
11
+ * exposed. Direct port of the React `ApiError`.
12
+ */
13
+ export class ApiError extends Error {
14
+ readonly errors: string[];
15
+ constructor(errors: string[]) {
16
+ super(errors[0]);
17
+ this.name = "ApiError";
18
+ this.errors = errors;
19
+ }
20
+ }
21
+
22
+ /**
23
+ * Helper to parse the fetch Response. Handles the distinction between success
24
+ * (JSON) and failure (throwing Error). Ported from the React `handleApiResponse`.
25
+ */
26
+ export async function handleApiResponse<T = unknown>(response: Response): Promise<T> {
27
+ // Robustness: Handle 204 No Content gracefully
28
+ if (response.status === 204) {
29
+ return {} as T;
30
+ }
31
+
32
+ let data: { errors?: string[] } | null = null;
33
+
34
+ const contentType = response.headers.get("content-type");
35
+ if (contentType?.includes("application/json")) {
36
+ data = (await response.json()) as { errors?: string[] };
37
+ } else {
38
+ // If Salesforce returns HTML (e.g. standard error page), consume the text
39
+ // to avoid parsing errors.
40
+ await response.text();
41
+ }
42
+
43
+ if (!response.ok) {
44
+ console.error("API request failed", data);
45
+ if (data?.errors?.length) {
46
+ throw new ApiError(data.errors);
47
+ }
48
+ throw new Error("An unexpected error occurred");
49
+ }
50
+
51
+ return data as T;
52
+ }
53
+
54
+ /** UI API Record response structure. */
55
+ export type RecordResponse = {
56
+ fields: Record<string, { value: string }>;
57
+ };
58
+
59
+ /**
60
+ * GraphQL can return a complex nested structure. This helper flattens it to a
61
+ * simple object for easier form binding. Ported from the React
62
+ * `flattenGraphQLRecord`.
63
+ *
64
+ * @param data - Extracted payload from the GraphQL response.
65
+ * @param fallbackError - Fallback error message if data is null/undefined or not an object.
66
+ * @throws {Error} If data is not valid.
67
+ * @returns Flattened object with values mapped directly to the fields.
68
+ */
69
+ export function flattenGraphQLRecord<T>(
70
+ data: unknown,
71
+ fallbackError = "An unknown error occurred",
72
+ ): T {
73
+ if (!data || typeof data !== "object") {
74
+ throw new Error(fallbackError);
75
+ }
76
+
77
+ return Object.fromEntries(
78
+ Object.entries(data as Record<string, unknown>).map(([key, field]) => [
79
+ key,
80
+ field !== null && typeof field === "object" && "value" in field
81
+ ? (field as { value: unknown }).value
82
+ : (field ?? null),
83
+ ]),
84
+ ) as T;
85
+ }
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /**
8
+ * SessionTimeServlet API helpers — direct (pure-TS) port of the React
9
+ * `sessionTimeService.ts`. Handles communication with the session validation
10
+ * endpoint, strips the CSRF prefix, and subtracts the latency buffer. Returns
11
+ * `undefined` on any failure so the session-timeout feature never crashes the
12
+ * running application.
13
+ */
14
+
15
+ import { SESSION_CONFIG } from "./session-timeout.config";
16
+
17
+ /** Response from SessionTimeServlet API. */
18
+ export interface SessionResponse {
19
+ /** Session phase. */
20
+ sp: number;
21
+ /** Seconds remaining in session. */
22
+ sr: number;
23
+ }
24
+
25
+ /**
26
+ * Parse the servlet response text into a SessionResponse object. Handles the
27
+ * CSRF protection prefix.
28
+ *
29
+ * @param text - Raw response text from servlet.
30
+ * @returns Parsed session response, or undefined if parsing fails.
31
+ */
32
+ export function parseResponseResult(text: string): SessionResponse | undefined {
33
+ let cleanedText = text;
34
+
35
+ // Strip CSRF protection prefix if present.
36
+ if (cleanedText.startsWith(SESSION_CONFIG.CSRF_TOKEN)) {
37
+ cleanedText = cleanedText.substring(SESSION_CONFIG.CSRF_TOKEN.length);
38
+ }
39
+
40
+ // Trim whitespace.
41
+ cleanedText = cleanedText.trim();
42
+
43
+ try {
44
+ const parsed = JSON.parse(cleanedText) as SessionResponse;
45
+
46
+ // Validate response structure.
47
+ if (typeof parsed.sp !== "number" || typeof parsed.sr !== "number") {
48
+ throw new Error("Invalid response structure: missing sp or sr properties");
49
+ }
50
+
51
+ return parsed;
52
+ } catch (error) {
53
+ console.error("[sessionTimeService] Failed to parse response:", error, "Text:", cleanedText);
54
+ return undefined;
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Call SessionTimeServlet API. Internal function used by both poll and extend.
60
+ * Returns undefined on any failure.
61
+ *
62
+ * @param basePath - Community base path (e.g., "/sfsites/c/").
63
+ * @param extend - Whether to extend the session (updateTimedOutSession param).
64
+ */
65
+ async function callSessionTimeServlet(
66
+ basePath: string,
67
+ extend = false,
68
+ ): Promise<SessionResponse | undefined> {
69
+ // Build URL with cache-busting timestamp.
70
+ const timestamp = Date.now();
71
+ let url = `${basePath}${SESSION_CONFIG.SERVLET_URL}?buster=${timestamp}`;
72
+
73
+ if (extend) {
74
+ url += "&updateTimedOutSession=true";
75
+ }
76
+
77
+ try {
78
+ const response = await fetch(url, {
79
+ method: "GET",
80
+ credentials: "same-origin",
81
+ cache: "no-cache",
82
+ headers: {
83
+ "X-Requested-With": "XMLHttpRequest",
84
+ },
85
+ });
86
+
87
+ if (!response.ok) {
88
+ console.error(`[sessionTimeService] HTTP ${response.status}: ${response.statusText}`);
89
+ return undefined;
90
+ }
91
+
92
+ const contentType = response.headers.get("content-type");
93
+ if (contentType && !contentType.includes("text") && !contentType.includes("json")) {
94
+ console.error(`[sessionTimeService] Unexpected content type: ${contentType}`);
95
+ return undefined;
96
+ }
97
+
98
+ const text = await response.text();
99
+ const parsed = parseResponseResult(text);
100
+ if (!parsed) {
101
+ return undefined;
102
+ }
103
+
104
+ return {
105
+ sp: parsed.sp,
106
+ sr: Math.max(0, parsed.sr - SESSION_CONFIG.LATENCY_BUFFER_SECONDS),
107
+ };
108
+ } catch (error) {
109
+ console.error("[sessionTimeService] API call failed:", error);
110
+ return undefined;
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Poll SessionTimeServlet to check remaining session time. Called periodically
116
+ * to monitor session status.
117
+ */
118
+ export async function pollSessionTimeServlet(
119
+ basePath: string,
120
+ ): Promise<SessionResponse | undefined> {
121
+ return callSessionTimeServlet(basePath, false);
122
+ }
123
+
124
+ /**
125
+ * Extend the current session time. Called when the user clicks "Continue" in the
126
+ * warning modal.
127
+ */
128
+ export async function extendSessionTime(basePath: string): Promise<SessionResponse | undefined> {
129
+ return callSessionTimeServlet(basePath, true);
130
+ }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /**
8
+ * Configuration constants for session timeout monitoring. Direct port of the
9
+ * React `sessionTimeoutConfig.ts` — values are byte-for-byte identical so the
10
+ * polling cadence, retry backoff, and warning window match exactly.
11
+ */
12
+
13
+ // ---------------------------------------------------------------------------
14
+ // Retry Configuration
15
+ // ---------------------------------------------------------------------------
16
+
17
+ /** Initial delay for first retry attempt (2 seconds). */
18
+ export const INITIAL_RETRY_DELAY = 2000;
19
+
20
+ /** Maximum number of retry attempts before giving up. */
21
+ export const MAX_RETRY_ATTEMPTS = 10;
22
+
23
+ /** Maximum retry delay (30 minutes). */
24
+ export const MAX_RETRY_DELAY = 30 * 60 * 1000;
25
+
26
+ // ---------------------------------------------------------------------------
27
+ // Session Storage Keys
28
+ // ---------------------------------------------------------------------------
29
+
30
+ /** sessionStorage keys used by the session validator. */
31
+ export const STORAGE_KEYS = {
32
+ /** Flag to show session expired message on login page. */
33
+ SHOW_SESSION_MESSAGE: "lwrSessionValidator.showSessionMessage",
34
+ } as const;
35
+
36
+ // ---------------------------------------------------------------------------
37
+ // Servlet Configuration
38
+ // ---------------------------------------------------------------------------
39
+
40
+ /** SessionTimeServlet configuration. */
41
+ export const SESSION_CONFIG = {
42
+ /** Relative URL to SessionTimeServlet. */
43
+ SERVLET_URL: "/sfsites/c/_nc_external/system/security/session/SessionTimeServlet",
44
+
45
+ /** Latency buffer to subtract from server response (seconds). */
46
+ LATENCY_BUFFER_SECONDS: 3,
47
+
48
+ /** CSRF protection prefix in servlet responses. */
49
+ CSRF_TOKEN: "while(1);\n",
50
+ } as const;
51
+
52
+ // ---------------------------------------------------------------------------
53
+ // UI Labels
54
+ // ---------------------------------------------------------------------------
55
+
56
+ /** UI labels for session timeout components. */
57
+ export const LABELS = {
58
+ /** Title for session warning modal. */
59
+ sessionWarningTitle: "Session Timeout Warning",
60
+
61
+ /** Message text in session warning modal. */
62
+ sessionWarningMessage:
63
+ "For security, we log you out if you’re inactive for too long. To continue working, click Continue before the time expires.",
64
+
65
+ /** Text for "Continue" button. */
66
+ continueButton: "Continue",
67
+
68
+ /** Text for "Log Out" button. */
69
+ logoutButton: "Log Out",
70
+
71
+ /** Message shown on login page after session expires. */
72
+ invalidSessionMessage: "Your session has expired. Please log in again.",
73
+
74
+ /** Accessibility label for close button. */
75
+ closeLabel: "Close",
76
+ } as const;
77
+
78
+ // ---------------------------------------------------------------------------
79
+ // Session Timeout Configuration
80
+ // ---------------------------------------------------------------------------
81
+
82
+ /** Session warning time in seconds (30 seconds). */
83
+ export const SESSION_WARNING_TIME = 30;
@@ -0,0 +1,201 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { Injectable, signal } from "@angular/core";
7
+ import {
8
+ extendSessionTime,
9
+ pollSessionTimeServlet,
10
+ type SessionResponse,
11
+ } from "./session-time-servlet";
12
+ import {
13
+ INITIAL_RETRY_DELAY,
14
+ MAX_RETRY_ATTEMPTS,
15
+ MAX_RETRY_DELAY,
16
+ SESSION_WARNING_TIME,
17
+ } from "./session-timeout.config";
18
+
19
+ /**
20
+ * Session-timeout monitoring service — the Angular port of the React
21
+ * `useSessionTimeout` hook (plus the inlined `useRetryWithBackoff`). Polls
22
+ * SessionTimeServlet at calculated intervals, shows the warning window when the
23
+ * session nears expiry, and retries failed polls with exponential backoff.
24
+ *
25
+ * State is exposed as signals; the owning `SessionTimeoutValidatorComponent`
26
+ * reacts to them and performs navigation/logout (this service, like the React
27
+ * hook, never navigates — it only tracks time and schedules checks).
28
+ *
29
+ * NOT `providedIn: 'root'`: it is provided by the validator component so its
30
+ * timers are torn down with that component (mirrors the hook's unmount cleanup).
31
+ */
32
+ @Injectable()
33
+ export class SessionTimeoutService {
34
+ // -- Public session state (signals) --------------------------------------
35
+ /** Seconds remaining in the current session (null until first response). */
36
+ readonly timeLeftInSession = signal<number | null>(null);
37
+ /** Whether the warning modal should be displayed. */
38
+ readonly showWarningModal = signal<boolean>(false);
39
+ /** Whether a poll is currently in flight. */
40
+ readonly isPolling = signal<boolean>(false);
41
+
42
+ // -- Retry (exponential backoff) state ------------------------------------
43
+ private retryAttempts = 0;
44
+ private currentRetryDelay = INITIAL_RETRY_DELAY;
45
+
46
+ // -- Timer / guard bookkeeping --------------------------------------------
47
+ private basePath = "";
48
+ private pollTimeoutId: ReturnType<typeof setTimeout> | null = null;
49
+ private retryTimeoutId: ReturnType<typeof setTimeout> | null = null;
50
+ private isPollingGuard = false;
51
+
52
+ private get maxRetriesReached(): boolean {
53
+ return this.retryAttempts >= MAX_RETRY_ATTEMPTS;
54
+ }
55
+
56
+ private resetRetry(): void {
57
+ this.retryAttempts = 0;
58
+ this.currentRetryDelay = INITIAL_RETRY_DELAY;
59
+ }
60
+
61
+ private clearPollTimeout(): void {
62
+ if (this.pollTimeoutId) {
63
+ clearTimeout(this.pollTimeoutId);
64
+ this.pollTimeoutId = null;
65
+ }
66
+ }
67
+
68
+ private clearRetryTimeout(): void {
69
+ if (this.retryTimeoutId) {
70
+ clearTimeout(this.retryTimeoutId);
71
+ this.retryTimeoutId = null;
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Schedule the next session check, clearing any pending poll/retry to prevent
77
+ * concurrent polling. Mirrors the hook's `scheduleCheck`.
78
+ */
79
+ private scheduleCheck(delay: number): void {
80
+ this.clearPollTimeout();
81
+ this.clearRetryTimeout();
82
+ this.pollTimeoutId = setTimeout(() => {
83
+ void this.checkSession();
84
+ }, delay);
85
+ }
86
+
87
+ /**
88
+ * Handle a failed poll/extend with exponential backoff. Mirrors the hook's
89
+ * `handleRetryWithBackoff` + `useRetryWithBackoff.scheduleRetry`.
90
+ */
91
+ private handleRetryWithBackoff(retryAction: () => void): void {
92
+ if (this.maxRetriesReached) {
93
+ console.error("[SessionTimeout] Max retry attempts reached. Stopping polling.");
94
+ this.isPolling.set(false);
95
+ this.isPollingGuard = false;
96
+ return;
97
+ }
98
+
99
+ if (this.isPollingGuard) {
100
+ console.warn("[SessionTimeout] Poll already in progress, skipping retry scheduling");
101
+ return;
102
+ }
103
+
104
+ this.clearRetryTimeout();
105
+
106
+ const delay = this.currentRetryDelay;
107
+ console.warn(
108
+ `[SessionTimeout] Scheduling retry attempt ${this.retryAttempts + 1}/${MAX_RETRY_ATTEMPTS} in ${delay}ms`,
109
+ );
110
+
111
+ this.retryTimeoutId = setTimeout(() => {
112
+ this.retryTimeoutId = null;
113
+ retryAction();
114
+ }, delay);
115
+
116
+ this.retryAttempts += 1;
117
+ // Double the delay for the next retry, capped at maxDelay.
118
+ this.currentRetryDelay = Math.min(this.currentRetryDelay * 2, MAX_RETRY_DELAY);
119
+ }
120
+
121
+ /**
122
+ * Process a session response and schedule the next check. Mirrors the hook's
123
+ * `processTimeoutResponse`. When `sr <= 0` the component's effect performs
124
+ * logout; when within the warning window the modal is shown and a check is
125
+ * scheduled for expiry; otherwise a check is scheduled for when the warning
126
+ * should appear.
127
+ */
128
+ private processTimeoutResponse(secondsRemaining: number): void {
129
+ this.timeLeftInSession.set(secondsRemaining);
130
+
131
+ if (secondsRemaining <= 0) {
132
+ this.showWarningModal.set(false);
133
+ // logout() is triggered by the component reacting to timeLeftInSession.
134
+ return;
135
+ }
136
+
137
+ const shouldShowWarning = secondsRemaining <= SESSION_WARNING_TIME;
138
+
139
+ if (shouldShowWarning) {
140
+ this.showWarningModal.set(true);
141
+ this.scheduleCheck(secondsRemaining * 1000);
142
+ } else {
143
+ const timeUntilWarning = (secondsRemaining - SESSION_WARNING_TIME) * 1000;
144
+ this.showWarningModal.set(false);
145
+ this.scheduleCheck(timeUntilWarning);
146
+ }
147
+ }
148
+
149
+ /** Check session status via the servlet. Mirrors the hook's `checkSession`. */
150
+ async checkSession(): Promise<void> {
151
+ if (this.isPollingGuard) {
152
+ return;
153
+ }
154
+
155
+ this.isPollingGuard = true;
156
+ this.isPolling.set(true);
157
+
158
+ const response = await pollSessionTimeServlet(this.basePath);
159
+ this.isPollingGuard = false;
160
+ this.isPolling.set(false);
161
+
162
+ this.applyResponse(response, () => void this.checkSession());
163
+ }
164
+
165
+ /** Extend the session (user clicked "Continue"). Mirrors `extendSession`. */
166
+ async extendSession(): Promise<void> {
167
+ const response = await extendSessionTime(this.basePath);
168
+ this.applyResponse(response, () => void this.extendSession());
169
+ }
170
+
171
+ private applyResponse(response: SessionResponse | undefined, retryAction: () => void): void {
172
+ if (response) {
173
+ this.resetRetry();
174
+ this.processTimeoutResponse(response.sr);
175
+ } else {
176
+ this.handleRetryWithBackoff(retryAction);
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Begin monitoring. Skips guests (mirrors the hook's guest short-circuit) and
182
+ * kicks off the first check.
183
+ */
184
+ start(basePath: string, isGuest: boolean): void {
185
+ this.basePath = basePath;
186
+ if (isGuest) {
187
+ return;
188
+ }
189
+ void this.checkSession();
190
+ }
191
+
192
+ /** Stop monitoring and reset state. Mirrors the hook's `logout` cleanup. */
193
+ stop(): void {
194
+ this.clearPollTimeout();
195
+ this.clearRetryTimeout();
196
+ this.showWarningModal.set(false);
197
+ this.timeLeftInSession.set(null);
198
+ this.isPolling.set(false);
199
+ this.isPollingGuard = false;
200
+ }
201
+ }
@@ -0,0 +1,68 @@
1
+ <main class="flex min-h-svh w-full justify-center p-6 md:p-10 items-start">
2
+ <div class="w-full max-w-md">
3
+ <app-auth-form
4
+ title="Change Password"
5
+ description="Enter your current and new password below"
6
+ [showAlreadyLoggedIn]="false"
7
+ [error]="submitError()"
8
+ [success]="
9
+ success()
10
+ ? 'Password changed successfully! Use the link below to return to your profile.'
11
+ : null
12
+ "
13
+ submitText="Change Password"
14
+ submitLoadingText="Changing…"
15
+ [submitting]="submitting()"
16
+ [submitDisabled]="success()"
17
+ [footer]="{ link: routes.PROFILE.PATH, linkText: 'Back to Profile' }"
18
+ (submitted)="onSubmit()"
19
+ >
20
+ <div class="mt-4 flex flex-col gap-4">
21
+ <app-field
22
+ label="Current Password"
23
+ htmlFor="change-current-password"
24
+ [error]="controlError('currentPassword', 'required')"
25
+ >
26
+ <app-input
27
+ type="password"
28
+ [value]="form.controls.currentPassword.value ?? ''"
29
+ (valueChange)="setControl('currentPassword', $event)"
30
+ [placeholder]="placeholders.PASSWORD"
31
+ [disabled]="success()"
32
+ />
33
+ </app-field>
34
+
35
+ <app-field
36
+ label="New Password"
37
+ htmlFor="change-new-password"
38
+ [error]="controlError('newPassword', 'password')"
39
+ >
40
+ <app-input
41
+ type="password"
42
+ [value]="form.controls.newPassword.value ?? ''"
43
+ (valueChange)="setControl('newPassword', $event)"
44
+ [placeholder]="placeholders.PASSWORD_NEW"
45
+ [disabled]="success()"
46
+ />
47
+ </app-field>
48
+
49
+ <app-field
50
+ label="Confirm Password"
51
+ htmlFor="change-confirm-password"
52
+ [error]="
53
+ controlError('confirmPassword', 'passwordMismatch') ??
54
+ controlError('confirmPassword', 'required')
55
+ "
56
+ >
57
+ <app-input
58
+ type="password"
59
+ [value]="form.controls.confirmPassword.value ?? ''"
60
+ (valueChange)="setControl('confirmPassword', $event)"
61
+ [placeholder]="placeholders.PASSWORD_NEW_CONFIRM"
62
+ [disabled]="success()"
63
+ />
64
+ </app-field>
65
+ </div>
66
+ </app-auth-form>
67
+ </div>
68
+ </main>
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { ChangeDetectionStrategy, Component, inject, signal } from "@angular/core";
7
+ import { FormBuilder } from "@angular/forms";
8
+ import { DataClient } from "../../api/data-client.service";
9
+ import { AuthFormComponent } from "../../features/authentication/auth-form/auth-form";
10
+ import { ReactiveFormPageBase } from "../../features/authentication/reactive-form-page.base";
11
+ import { FieldComponent } from "../../components/ui/field/field";
12
+ import { InputComponent } from "../../components/ui/input/input";
13
+ import {
14
+ API_ROUTES,
15
+ AUTH_PLACEHOLDERS,
16
+ ROUTES,
17
+ } from "../../features/authentication/config/authentication.config";
18
+ import { ApiError, handleApiResponse } from "../../features/authentication/utils/helpers";
19
+ import {
20
+ passwordMinValidator,
21
+ passwordsMatchValidator,
22
+ requiredWithMessage,
23
+ } from "../../features/authentication/utils/auth-validators";
24
+
25
+ /**
26
+ * Change-password page — Angular port of the React `ChangePassword`. Protected
27
+ * route (guarded in `app.routes.ts`). Sends `{ currentPassword, newPassword }`;
28
+ * on success it resets the form and shows a success alert with a Back-to-Profile
29
+ * link. `showAlreadyLoggedIn` is false (the user is expected to be logged in).
30
+ */
31
+ @Component({
32
+ selector: "app-change-password-page",
33
+ changeDetection: ChangeDetectionStrategy.OnPush,
34
+ imports: [AuthFormComponent, FieldComponent, InputComponent],
35
+ templateUrl: "./change-password-page.html",
36
+ })
37
+ export class ChangePasswordPageComponent extends ReactiveFormPageBase {
38
+ private readonly fb = inject(FormBuilder);
39
+ private readonly dataClient = inject(DataClient);
40
+
41
+ protected readonly placeholders = AUTH_PLACEHOLDERS;
42
+ protected readonly routes = ROUTES;
43
+
44
+ protected override readonly form = this.fb.group(
45
+ {
46
+ currentPassword: ["", [requiredWithMessage("Current password is required")]],
47
+ newPassword: ["", [passwordMinValidator]],
48
+ confirmPassword: ["", [requiredWithMessage("Please confirm your password")]],
49
+ },
50
+ { validators: [passwordsMatchValidator("newPassword", "confirmPassword")] },
51
+ );
52
+
53
+ protected readonly submitError = signal<string | string[] | null>(null);
54
+ protected readonly submitting = signal<boolean>(false);
55
+ protected readonly success = signal<boolean>(false);
56
+
57
+ protected async onSubmit(): Promise<void> {
58
+ this.form.markAllAsTouched();
59
+ if (this.form.invalid) {
60
+ return;
61
+ }
62
+ this.submitError.set(null);
63
+ this.success.set(false);
64
+ this.submitting.set(true);
65
+ try {
66
+ const { currentPassword, newPassword } = this.form.getRawValue();
67
+ const response = await this.dataClient.fetch(API_ROUTES.CHANGE_PASSWORD, {
68
+ method: "POST",
69
+ body: JSON.stringify({ currentPassword, newPassword }),
70
+ headers: { "Content-Type": "application/json", Accept: "application/json" },
71
+ });
72
+ await handleApiResponse(response);
73
+ this.success.set(true);
74
+ this.form.reset({ currentPassword: "", newPassword: "", confirmPassword: "" });
75
+ } catch (err) {
76
+ console.error("Password change failed", err);
77
+ this.submitError.set(err instanceof ApiError ? err.errors : "Password change failed");
78
+ } finally {
79
+ this.submitting.set(false);
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,35 @@
1
+ <main class="flex min-h-svh w-full justify-center p-6 md:p-10 items-start">
2
+ <div class="w-full max-w-md">
3
+ <app-auth-form
4
+ title="Forgot Password"
5
+ description="Enter your username and we'll send you a reset link"
6
+ [error]="submitError()"
7
+ [success]="
8
+ success()
9
+ ? 'If that username exists in our system, you will receive a reset link shortly.'
10
+ : null
11
+ "
12
+ submitText="Send Reset Link"
13
+ submitLoadingText="Sending…"
14
+ [submitting]="submitting()"
15
+ [submitDisabled]="success()"
16
+ [footer]="{ text: 'Remember your password?', link: routes.LOGIN.PATH, linkText: 'Sign in' }"
17
+ (submitted)="onSubmit()"
18
+ >
19
+ <div class="mt-4 flex flex-col gap-4">
20
+ <app-field
21
+ label="Username"
22
+ htmlFor="forgot-username"
23
+ [error]="controlError('username', 'email')"
24
+ >
25
+ <app-input
26
+ [value]="form.controls.username.value ?? ''"
27
+ (valueChange)="setControl('username', $event)"
28
+ [placeholder]="placeholders.USERNAME"
29
+ [disabled]="success()"
30
+ />
31
+ </app-field>
32
+ </div>
33
+ </app-auth-form>
34
+ </div>
35
+ </main>