keycloakify 10.0.0-rc.17 → 10.0.0-rc.18

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 (205) hide show
  1. package/PUBLIC_URL.js.map +1 -1
  2. package/account/Template.js +5 -5
  3. package/account/Template.js.map +1 -1
  4. package/account/i18n/i18n.js +37 -29
  5. package/account/i18n/i18n.js.map +1 -1
  6. package/account/kcContext/KcContext.js.map +1 -1
  7. package/account/kcContext/createGetKcContext.js +20 -15
  8. package/account/kcContext/createGetKcContext.js.map +1 -1
  9. package/account/kcContext/getKcContext.js.map +1 -1
  10. package/account/kcContext/getKcContextFromWindow.d.ts +3 -1
  11. package/account/kcContext/getKcContextFromWindow.js.map +1 -1
  12. package/account/kcContext/kcContextMocks.js +148 -144
  13. package/account/kcContext/kcContextMocks.js.map +1 -1
  14. package/account/lib/useGetClassName.js +14 -14
  15. package/account/lib/useGetClassName.js.map +1 -1
  16. package/account/pages/Account.js +1 -1
  17. package/account/pages/Account.js.map +1 -1
  18. package/account/pages/Password.js +7 -7
  19. package/account/pages/Password.js.map +1 -1
  20. package/account/pages/Totp.js +4 -4
  21. package/account/pages/Totp.js.map +1 -1
  22. package/bin/main.js +2066 -2165
  23. package/bin/shared/constants.d.ts +1 -0
  24. package/bin/shared/constants.js +4 -3
  25. package/bin/shared/constants.js.map +1 -1
  26. package/lib/isStorybook.js +2 -1
  27. package/lib/isStorybook.js.map +1 -1
  28. package/lib/useGetClassName.js.map +1 -1
  29. package/login/Template.js +13 -13
  30. package/login/Template.js.map +1 -1
  31. package/login/UserProfileFormFields.js +43 -41
  32. package/login/UserProfileFormFields.js.map +1 -1
  33. package/login/i18n/baseMessages/ca.d.ts +1 -1
  34. package/login/i18n/baseMessages/ca.js +1 -1
  35. package/login/i18n/baseMessages/el.d.ts +0 -1
  36. package/login/i18n/baseMessages/el.js +0 -1
  37. package/login/i18n/baseMessages/el.js.map +1 -1
  38. package/login/i18n/baseMessages/en.d.ts +1 -1
  39. package/login/i18n/baseMessages/en.js +1 -1
  40. package/login/i18n/baseMessages/es.d.ts +1 -1
  41. package/login/i18n/baseMessages/es.js +1 -1
  42. package/login/i18n/baseMessages/fa.d.ts +0 -1
  43. package/login/i18n/baseMessages/fa.js +0 -1
  44. package/login/i18n/baseMessages/fa.js.map +1 -1
  45. package/login/i18n/baseMessages/hu.d.ts +1 -1
  46. package/login/i18n/baseMessages/hu.js +1 -1
  47. package/login/i18n/baseMessages/index.d.ts +1 -2
  48. package/login/i18n/baseMessages/zh-CN.d.ts +1 -1
  49. package/login/i18n/baseMessages/zh-CN.js +1 -1
  50. package/login/i18n/i18n.js +39 -31
  51. package/login/i18n/i18n.js.map +1 -1
  52. package/login/kcContext/KcContext.js.map +1 -1
  53. package/login/kcContext/createGetKcContext.js +30 -22
  54. package/login/kcContext/createGetKcContext.js.map +1 -1
  55. package/login/kcContext/getKcContext.js.map +1 -1
  56. package/login/kcContext/getKcContextFromWindow.d.ts +3 -1
  57. package/login/kcContext/getKcContextFromWindow.js.map +1 -1
  58. package/login/kcContext/kcContextMocks.js +233 -231
  59. package/login/kcContext/kcContextMocks.js.map +1 -1
  60. package/login/lib/useDownloadTerms.js.map +1 -1
  61. package/login/lib/useGetClassName.js +112 -112
  62. package/login/lib/useGetClassName.js.map +1 -1
  63. package/login/lib/useUserProfileForm.js +181 -181
  64. package/login/lib/useUserProfileForm.js.map +1 -1
  65. package/login/pages/DeleteAccountConfirm.js +5 -1
  66. package/login/pages/DeleteAccountConfirm.js.map +1 -1
  67. package/login/pages/FrontchannelLogout.js +1 -1
  68. package/login/pages/FrontchannelLogout.js.map +1 -1
  69. package/login/pages/Login.js.map +1 -1
  70. package/login/pages/LoginRecoveryAuthnCodeConfig.js +3 -3
  71. package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
  72. package/login/pages/LoginResetPassword.js.map +1 -1
  73. package/login/pages/LoginUsername.js.map +1 -1
  74. package/login/pages/WebauthnAuthenticate.js +11 -8
  75. package/login/pages/WebauthnAuthenticate.js.map +1 -1
  76. package/login/pages/WebauthnRegister.js +7 -7
  77. package/login/pages/WebauthnRegister.js.map +1 -1
  78. package/package.json +230 -226
  79. package/src/PUBLIC_URL.ts +4 -1
  80. package/src/account/Template.tsx +5 -5
  81. package/src/account/TemplateProps.ts +4 -1
  82. package/src/account/i18n/i18n.tsx +40 -30
  83. package/src/account/kcContext/KcContext.ts +4 -1
  84. package/src/account/kcContext/createGetKcContext.ts +48 -22
  85. package/src/account/kcContext/getKcContext.ts +3 -1
  86. package/src/account/kcContext/getKcContextFromWindow.ts +6 -2
  87. package/src/account/kcContext/kcContextMocks.ts +164 -160
  88. package/src/account/lib/useGetClassName.ts +15 -14
  89. package/src/account/pages/Account.tsx +2 -2
  90. package/src/account/pages/Password.tsx +8 -8
  91. package/src/account/pages/Totp.tsx +4 -6
  92. package/src/bin/copy-keycloak-resources-to-public.ts +2 -2
  93. package/src/bin/download-keycloak-default-theme.ts +30 -8
  94. package/src/bin/eject-page.ts +48 -11
  95. package/src/bin/initialize-email-theme.ts +25 -17
  96. package/src/bin/keycloakify/buildJars/buildJar.ts +179 -104
  97. package/src/bin/keycloakify/buildJars/buildJars.ts +35 -16
  98. package/src/bin/keycloakify/buildJars/extensionVersions.ts +2 -1
  99. package/src/bin/keycloakify/buildJars/generatePom.ts +11 -3
  100. package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +33 -8
  101. package/src/bin/keycloakify/generateFtl/generateFtl.ts +49 -12
  102. package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +29 -18
  103. package/src/bin/keycloakify/generateSrcMainResources/generateMessageProperties.ts +35 -12
  104. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +3 -1
  105. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +86 -41
  106. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +39 -15
  107. package/src/bin/keycloakify/generateSrcMainResources/readExtraPageNames.ts +21 -7
  108. package/src/bin/keycloakify/generateSrcMainResources/readFieldNameUsage.ts +34 -7
  109. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +19 -5
  110. package/src/bin/keycloakify/keycloakify.ts +28 -9
  111. package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +24 -5
  112. package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +6 -2
  113. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +6 -3
  114. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +24 -6
  115. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +49 -11
  116. package/src/bin/main.ts +78 -41
  117. package/src/bin/shared/KeycloakVersionRange.ts +3 -1
  118. package/src/bin/shared/buildOptions.ts +70 -43
  119. package/src/bin/shared/constants.ts +4 -2
  120. package/src/bin/shared/copyKeycloakResourcesToPublic.ts +27 -13
  121. package/src/bin/shared/downloadKeycloakDefaultTheme.ts +161 -218
  122. package/src/bin/shared/downloadKeycloakStaticResources.ts +25 -21
  123. package/src/bin/shared/getJarFileBasename.ts +3 -1
  124. package/src/bin/shared/getThemeSrcDirPath.ts +5 -2
  125. package/src/bin/shared/metaInfKeycloakThemes.ts +35 -8
  126. package/src/bin/shared/promptKeycloakVersion.ts +33 -14
  127. package/src/bin/start-keycloak/index.ts +1 -0
  128. package/src/bin/start-keycloak/myrealm-realm-23.json +2142 -0
  129. package/src/bin/start-keycloak/myrealm-realm-24.json +2318 -0
  130. package/src/bin/start-keycloak/start-keycloak.ts +467 -0
  131. package/src/bin/tools/SemVer.ts +32 -13
  132. package/src/bin/tools/String.prototype.replaceAll.ts +9 -2
  133. package/src/bin/tools/crawl.ts +4 -1
  134. package/src/bin/tools/crc32.ts +42 -24
  135. package/src/bin/tools/downloadAndExtractArchive/downloadAndExtractArchive.ts +262 -0
  136. package/src/bin/tools/downloadAndExtractArchive/fetchProxyOptions.ts +96 -0
  137. package/src/bin/tools/downloadAndExtractArchive/index.ts +1 -0
  138. package/src/bin/tools/extractArchive.ts +120 -0
  139. package/src/bin/tools/fetchProxyOptions.ts +31 -8
  140. package/src/bin/tools/getAbsoluteAndInOsFormatPath.ts +10 -2
  141. package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +18 -5
  142. package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +8 -2
  143. package/src/bin/tools/octokit-addons/listTags.ts +15 -4
  144. package/src/bin/tools/partitionPromiseSettledResults.ts +12 -3
  145. package/src/bin/tools/readThisNpmPackageVersion.ts +5 -1
  146. package/src/bin/tools/transformCodebase.ts +29 -10
  147. package/src/bin/tools/trimIndent.ts +4 -1
  148. package/src/lib/isStorybook.ts +3 -1
  149. package/src/lib/useGetClassName.ts +12 -3
  150. package/src/login/Template.tsx +14 -14
  151. package/src/login/TemplateProps.ts +4 -1
  152. package/src/login/UserProfileFormFields.tsx +44 -42
  153. package/src/login/i18n/baseMessages/ca.ts +1 -1
  154. package/src/login/i18n/baseMessages/el.ts +0 -1
  155. package/src/login/i18n/baseMessages/en.ts +1 -1
  156. package/src/login/i18n/baseMessages/es.ts +1 -1
  157. package/src/login/i18n/baseMessages/fa.ts +0 -1
  158. package/src/login/i18n/baseMessages/hu.ts +1 -1
  159. package/src/login/i18n/baseMessages/zh-CN.ts +1 -1
  160. package/src/login/i18n/i18n.tsx +42 -32
  161. package/src/login/kcContext/KcContext.ts +8 -2
  162. package/src/login/kcContext/createGetKcContext.ts +84 -37
  163. package/src/login/kcContext/getKcContext.ts +3 -1
  164. package/src/login/kcContext/getKcContextFromWindow.ts +6 -2
  165. package/src/login/kcContext/kcContextMocks.ts +339 -325
  166. package/src/login/lib/useDownloadTerms.ts +6 -4
  167. package/src/login/lib/useGetClassName.ts +119 -112
  168. package/src/login/lib/useUserProfileForm.tsx +219 -205
  169. package/src/login/pages/DeleteAccountConfirm.tsx +9 -3
  170. package/src/login/pages/FrontchannelLogout.tsx +1 -1
  171. package/src/login/pages/Login.tsx +2 -2
  172. package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +3 -3
  173. package/src/login/pages/LoginResetPassword.tsx +2 -2
  174. package/src/login/pages/LoginUsername.tsx +2 -2
  175. package/src/login/pages/WebauthnAuthenticate.tsx +11 -8
  176. package/src/login/pages/WebauthnRegister.tsx +7 -7
  177. package/src/tools/AndByDiscriminatingKey.ts +12 -6
  178. package/src/tools/Array.prototype.every.ts +4 -1
  179. package/src/tools/LazyOrNot.ts +3 -1
  180. package/src/tools/clsx.ts +7 -1
  181. package/src/tools/deepAssign.ts +15 -8
  182. package/src/tools/deepClone.ts +3 -1
  183. package/src/tools/formatNumber.ts +4 -1
  184. package/src/tools/useConstCallback.ts +3 -1
  185. package/src/tools/useInsertLinkTags.ts +20 -7
  186. package/src/tools/useInsertScriptTags.ts +7 -2
  187. package/src/tools/useSetClassName.ts +4 -1
  188. package/src/vite-plugin/vite-plugin.ts +45 -21
  189. package/tools/Array.prototype.every.js +2 -1
  190. package/tools/Array.prototype.every.js.map +1 -1
  191. package/tools/clsx.js.map +1 -1
  192. package/tools/deepAssign.js +9 -7
  193. package/tools/deepAssign.js.map +1 -1
  194. package/tools/deepClone.js.map +1 -1
  195. package/tools/formatNumber.js.map +1 -1
  196. package/tools/useConstCallback.js.map +1 -1
  197. package/tools/useInsertLinkTags.js +5 -4
  198. package/tools/useInsertLinkTags.js.map +1 -1
  199. package/tools/useInsertScriptTags.js +5 -2
  200. package/tools/useInsertScriptTags.js.map +1 -1
  201. package/tools/useSetClassName.js.map +1 -1
  202. package/vite-plugin/index.js +975 -1651
  203. package/src/bin/shared/downloadAndUnzip.ts +0 -203
  204. package/src/bin/start-keycloak.ts +0 -309
  205. package/src/bin/tools/unzip.ts +0 -141
@@ -1,324 +1,336 @@
1
1
  import "minimal-polyfills/Object.fromEntries";
2
2
  import type { KcContext, Attribute } from "./KcContext";
3
- import { resources_common, keycloak_resources, type LoginThemePageId } from "keycloakify/bin/shared/constants";
3
+ import {
4
+ resources_common,
5
+ keycloak_resources,
6
+ type LoginThemePageId
7
+ } from "keycloakify/bin/shared/constants";
4
8
  import { id } from "tsafe/id";
5
9
  import { assert, type Equals } from "tsafe/assert";
6
10
  import { BASE_URL } from "keycloakify/lib/BASE_URL";
7
11
 
8
12
  const attributes: Attribute[] = [
9
13
  {
10
- "validators": {
11
- "length": {
14
+ validators: {
15
+ length: {
12
16
  "ignore.empty.value": true,
13
- "min": "3",
14
- "max": "255"
17
+ min: "3",
18
+ max: "255"
15
19
  }
16
20
  },
17
- "displayName": "${username}",
18
- "annotations": {},
19
- "required": true,
20
- "autocomplete": "username",
21
- "readOnly": false,
22
- "name": "username",
23
- "value": "xxxx"
21
+ displayName: "${username}",
22
+ annotations: {},
23
+ required: true,
24
+ autocomplete: "username",
25
+ readOnly: false,
26
+ name: "username",
27
+ value: "xxxx"
24
28
  },
25
29
  {
26
- "validators": {
27
- "length": {
28
- "max": "255",
30
+ validators: {
31
+ length: {
32
+ max: "255",
29
33
  "ignore.empty.value": true
30
34
  },
31
- "email": {
35
+ email: {
32
36
  "ignore.empty.value": true
33
37
  },
34
- "pattern": {
38
+ pattern: {
35
39
  "ignore.empty.value": true,
36
- "pattern": "gmail\\.com$"
40
+ pattern: "gmail\\.com$"
37
41
  }
38
42
  },
39
- "displayName": "${email}",
40
- "annotations": {},
41
- "required": true,
42
- "autocomplete": "email",
43
- "readOnly": false,
44
- "name": "email"
43
+ displayName: "${email}",
44
+ annotations: {},
45
+ required: true,
46
+ autocomplete: "email",
47
+ readOnly: false,
48
+ name: "email"
45
49
  },
46
50
  {
47
- "validators": {
48
- "length": {
49
- "max": "255",
51
+ validators: {
52
+ length: {
53
+ max: "255",
50
54
  "ignore.empty.value": true
51
55
  }
52
56
  },
53
- "displayName": "${firstName}",
54
- "annotations": {},
55
- "required": true,
56
- "readOnly": false,
57
- "name": "firstName"
57
+ displayName: "${firstName}",
58
+ annotations: {},
59
+ required: true,
60
+ readOnly: false,
61
+ name: "firstName"
58
62
  },
59
63
  {
60
- "validators": {
61
- "length": {
62
- "max": "255",
64
+ validators: {
65
+ length: {
66
+ max: "255",
63
67
  "ignore.empty.value": true
64
68
  }
65
69
  },
66
- "displayName": "${lastName}",
67
- "annotations": {},
68
- "required": true,
69
- "readOnly": false,
70
- "name": "lastName"
70
+ displayName: "${lastName}",
71
+ annotations: {},
72
+ required: true,
73
+ readOnly: false,
74
+ name: "lastName"
71
75
  }
72
76
  ];
73
77
 
74
- const attributesByName = Object.fromEntries(attributes.map(attribute => [attribute.name, attribute])) as any;
78
+ const attributesByName = Object.fromEntries(
79
+ attributes.map(attribute => [attribute.name, attribute])
80
+ ) as any;
75
81
 
76
82
  const resourcesPath = `${BASE_URL}${keycloak_resources}/login/resources`;
77
83
 
78
84
  export const kcContextCommonMock: KcContext.Common = {
79
- "themeVersion": "0.0.0",
80
- "keycloakifyVersion": "0.0.0",
81
- "themeType": "login",
82
- "themeName": "my-theme-name",
83
- "url": {
84
- "loginAction": "#",
85
+ themeVersion: "0.0.0",
86
+ keycloakifyVersion: "0.0.0",
87
+ themeType: "login",
88
+ themeName: "my-theme-name",
89
+ url: {
90
+ loginAction: "#",
85
91
  resourcesPath,
86
- "resourcesCommonPath": `${resourcesPath}/${resources_common}`,
87
- "loginRestartFlowUrl": "/auth/realms/myrealm/login-actions/restart?client_id=account&tab_id=HoAx28ja4xg",
88
- "loginUrl": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg",
89
- "ssoLoginInOtherTabsUrl": "/auth/realms/myrealm/login-actions/switch?client_id=account&tab_id=HoAx28ja4xg"
92
+ resourcesCommonPath: `${resourcesPath}/${resources_common}`,
93
+ loginRestartFlowUrl:
94
+ "/auth/realms/myrealm/login-actions/restart?client_id=account&tab_id=HoAx28ja4xg",
95
+ loginUrl:
96
+ "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg",
97
+ ssoLoginInOtherTabsUrl:
98
+ "/auth/realms/myrealm/login-actions/switch?client_id=account&tab_id=HoAx28ja4xg"
90
99
  },
91
- "realm": {
92
- "name": "myrealm",
93
- "displayName": "myrealm",
94
- "displayNameHtml": "myrealm",
95
- "internationalizationEnabled": true,
96
- "registrationEmailAsUsername": false
100
+ realm: {
101
+ name: "myrealm",
102
+ displayName: "myrealm",
103
+ displayNameHtml: "myrealm",
104
+ internationalizationEnabled: true,
105
+ registrationEmailAsUsername: false
97
106
  },
98
- "messagesPerField": {
99
- "printIfExists": () => {
107
+ messagesPerField: {
108
+ printIfExists: () => {
100
109
  return undefined;
101
110
  },
102
- "existsError": () => false,
103
- "get": fieldName => `Fake error for ${fieldName}`,
104
- "exists": () => false,
105
- "getFirstError": fieldName => `Fake error for ${fieldName}`
111
+ existsError: () => false,
112
+ get: fieldName => `Fake error for ${fieldName}`,
113
+ exists: () => false,
114
+ getFirstError: fieldName => `Fake error for ${fieldName}`
106
115
  },
107
- "locale": {
108
- "supported": [
116
+ locale: {
117
+ supported: [
109
118
  /* spell-checker: disable */
110
119
  {
111
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=de",
112
- "label": "Deutsch",
113
- "languageTag": "de"
120
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=de",
121
+ label: "Deutsch",
122
+ languageTag: "de"
114
123
  },
115
124
  {
116
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=no",
117
- "label": "Norsk",
118
- "languageTag": "no"
125
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=no",
126
+ label: "Norsk",
127
+ languageTag: "no"
119
128
  },
120
129
  {
121
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ru",
122
- "label": "Русский",
123
- "languageTag": "ru"
130
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ru",
131
+ label: "Русский",
132
+ languageTag: "ru"
124
133
  },
125
134
  {
126
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=sv",
127
- "label": "Svenska",
128
- "languageTag": "sv"
135
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=sv",
136
+ label: "Svenska",
137
+ languageTag: "sv"
129
138
  },
130
139
  {
131
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=pt-BR",
132
- "label": "Português (Brasil)",
133
- "languageTag": "pt-BR"
140
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=pt-BR",
141
+ label: "Português (Brasil)",
142
+ languageTag: "pt-BR"
134
143
  },
135
144
  {
136
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=lt",
137
- "label": "Lietuvių",
138
- "languageTag": "lt"
145
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=lt",
146
+ label: "Lietuvių",
147
+ languageTag: "lt"
139
148
  },
140
149
  {
141
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=en",
142
- "label": "English",
143
- "languageTag": "en"
150
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=en",
151
+ label: "English",
152
+ languageTag: "en"
144
153
  },
145
154
  {
146
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=it",
147
- "label": "Italiano",
148
- "languageTag": "it"
155
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=it",
156
+ label: "Italiano",
157
+ languageTag: "it"
149
158
  },
150
159
  {
151
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=fr",
152
- "label": "Français",
153
- "languageTag": "fr"
160
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=fr",
161
+ label: "Français",
162
+ languageTag: "fr"
154
163
  },
155
164
  {
156
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=zh-CN",
157
- "label": "中文简体",
158
- "languageTag": "zh-CN"
165
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=zh-CN",
166
+ label: "中文简体",
167
+ languageTag: "zh-CN"
159
168
  },
160
169
  {
161
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=es",
162
- "label": "Español",
163
- "languageTag": "es"
170
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=es",
171
+ label: "Español",
172
+ languageTag: "es"
164
173
  },
165
174
  {
166
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=cs",
167
- "label": "Čeština",
168
- "languageTag": "cs"
175
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=cs",
176
+ label: "Čeština",
177
+ languageTag: "cs"
169
178
  },
170
179
  {
171
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ja",
172
- "label": "日本語",
173
- "languageTag": "ja"
180
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ja",
181
+ label: "日本語",
182
+ languageTag: "ja"
174
183
  },
175
184
  {
176
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=sk",
177
- "label": "Slovenčina",
178
- "languageTag": "sk"
185
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=sk",
186
+ label: "Slovenčina",
187
+ languageTag: "sk"
179
188
  },
180
189
  {
181
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=pl",
182
- "label": "Polski",
183
- "languageTag": "pl"
190
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=pl",
191
+ label: "Polski",
192
+ languageTag: "pl"
184
193
  },
185
194
  {
186
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ca",
187
- "label": "Català",
188
- "languageTag": "ca"
195
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ca",
196
+ label: "Català",
197
+ languageTag: "ca"
189
198
  },
190
199
  {
191
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=nl",
192
- "label": "Nederlands",
193
- "languageTag": "nl"
200
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=nl",
201
+ label: "Nederlands",
202
+ languageTag: "nl"
194
203
  },
195
204
  {
196
- "url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=tr",
197
- "label": "Türkçe",
198
- "languageTag": "tr"
205
+ url: "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=tr",
206
+ label: "Türkçe",
207
+ languageTag: "tr"
199
208
  }
200
209
  /* spell-checker: enable */
201
210
  ],
202
- "currentLanguageTag": "en"
211
+ currentLanguageTag: "en"
203
212
  },
204
- "auth": {
205
- "showUsername": false,
206
- "showResetCredentials": false,
207
- "showTryAnotherWayLink": false
213
+ auth: {
214
+ showUsername: false,
215
+ showResetCredentials: false,
216
+ showTryAnotherWayLink: false
208
217
  },
209
- "client": {
210
- "clientId": "myApp",
211
- "attributes": {}
218
+ client: {
219
+ clientId: "myApp",
220
+ attributes: {}
212
221
  },
213
- "scripts": [],
214
- "isAppInitiatedAction": false,
215
- "properties": {}
222
+ scripts: [],
223
+ isAppInitiatedAction: false,
224
+ properties: {}
216
225
  };
217
226
 
218
227
  const loginUrl = {
219
228
  ...kcContextCommonMock.url,
220
- "loginResetCredentialsUrl": "/auth/realms/myrealm/login-actions/reset-credentials?client_id=account&tab_id=HoAx28ja4xg",
221
- "registrationUrl": "/auth/realms/myrealm/login-actions/registration?client_id=account&tab_id=HoAx28ja4xg",
222
- "oauth2DeviceVerificationAction": "/auth/realms/myrealm/device",
223
- "oauthAction": "/auth/realms/myrealm/login-actions/consent?client_id=account&tab_id=HoAx28ja4xg"
229
+ loginResetCredentialsUrl:
230
+ "/auth/realms/myrealm/login-actions/reset-credentials?client_id=account&tab_id=HoAx28ja4xg",
231
+ registrationUrl:
232
+ "/auth/realms/myrealm/login-actions/registration?client_id=account&tab_id=HoAx28ja4xg",
233
+ oauth2DeviceVerificationAction: "/auth/realms/myrealm/device",
234
+ oauthAction:
235
+ "/auth/realms/myrealm/login-actions/consent?client_id=account&tab_id=HoAx28ja4xg"
224
236
  };
225
237
 
226
238
  export const kcContextMocks = [
227
239
  id<KcContext.Login>({
228
240
  ...kcContextCommonMock,
229
- "pageId": "login.ftl",
230
- "url": loginUrl,
231
- "realm": {
241
+ pageId: "login.ftl",
242
+ url: loginUrl,
243
+ realm: {
232
244
  ...kcContextCommonMock.realm,
233
- "loginWithEmailAllowed": true,
234
- "rememberMe": true,
235
- "password": true,
236
- "resetPasswordAllowed": true,
237
- "registrationAllowed": true
245
+ loginWithEmailAllowed: true,
246
+ rememberMe: true,
247
+ password: true,
248
+ resetPasswordAllowed: true,
249
+ registrationAllowed: true
238
250
  },
239
- "auth": kcContextCommonMock.auth!,
240
- "social": {
241
- "displayInfo": true
251
+ auth: kcContextCommonMock.auth!,
252
+ social: {
253
+ displayInfo: true
242
254
  },
243
- "usernameHidden": false,
244
- "login": {},
245
- "registrationDisabled": false
255
+ usernameHidden: false,
256
+ login: {},
257
+ registrationDisabled: false
246
258
  }),
247
259
  id<KcContext.Register>({
248
260
  ...kcContextCommonMock,
249
- "url": {
261
+ url: {
250
262
  ...loginUrl,
251
- "registrationAction":
263
+ registrationAction:
252
264
  "http://localhost:8080/auth/realms/myrealm/login-actions/registration?session_code=gwZdUeO7pbYpFTRxiIxRg_QtzMbtFTKrNu6XW_f8asM&execution=12146ce0-b139-4bbd-b25b-0eccfee6577e&client_id=account&tab_id=uS8lYfebLa0"
253
265
  },
254
- "isAppInitiatedAction": false,
255
- "passwordRequired": true,
256
- "recaptchaRequired": false,
257
- "pageId": "register.ftl",
258
- "profile": {
266
+ isAppInitiatedAction: false,
267
+ passwordRequired: true,
268
+ recaptchaRequired: false,
269
+ pageId: "register.ftl",
270
+ profile: {
259
271
  attributes,
260
272
  attributesByName
261
273
  },
262
- "scripts": [
274
+ scripts: [
263
275
  //"https://www.google.com/recaptcha/api.js"
264
276
  ]
265
277
  }),
266
278
  id<KcContext.Info>({
267
279
  ...kcContextCommonMock,
268
- "pageId": "info.ftl",
269
- "messageHeader": "<Message header>",
270
- "requiredActions": undefined,
271
- "skipLink": false,
272
- "actionUri": "#",
273
- "client": {
274
- "clientId": "myApp",
275
- "baseUrl": "#",
276
- "attributes": {}
280
+ pageId: "info.ftl",
281
+ messageHeader: "<Message header>",
282
+ requiredActions: undefined,
283
+ skipLink: false,
284
+ actionUri: "#",
285
+ client: {
286
+ clientId: "myApp",
287
+ baseUrl: "#",
288
+ attributes: {}
277
289
  }
278
290
  }),
279
291
  id<KcContext.Error>({
280
292
  ...kcContextCommonMock,
281
- "pageId": "error.ftl",
282
- "client": {
283
- "clientId": "myApp",
284
- "baseUrl": "#",
285
- "attributes": {}
293
+ pageId: "error.ftl",
294
+ client: {
295
+ clientId: "myApp",
296
+ baseUrl: "#",
297
+ attributes: {}
286
298
  },
287
- "message": {
288
- "type": "error",
289
- "summary": "This is the error message"
299
+ message: {
300
+ type: "error",
301
+ summary: "This is the error message"
290
302
  }
291
303
  }),
292
304
  id<KcContext.LoginResetPassword>({
293
305
  ...kcContextCommonMock,
294
- "pageId": "login-reset-password.ftl",
295
- "realm": {
306
+ pageId: "login-reset-password.ftl",
307
+ realm: {
296
308
  ...kcContextCommonMock.realm,
297
- "loginWithEmailAllowed": false,
298
- "duplicateEmailsAllowed": false
309
+ loginWithEmailAllowed: false,
310
+ duplicateEmailsAllowed: false
299
311
  },
300
- "url": loginUrl,
301
- "auth": {}
312
+ url: loginUrl,
313
+ auth: {}
302
314
  }),
303
315
  id<KcContext.LoginVerifyEmail>({
304
316
  ...kcContextCommonMock,
305
- "pageId": "login-verify-email.ftl",
306
- "user": {
307
- "email": "john.doe@gmail.com"
317
+ pageId: "login-verify-email.ftl",
318
+ user: {
319
+ email: "john.doe@gmail.com"
308
320
  }
309
321
  }),
310
322
  id<KcContext.Terms>({
311
323
  ...kcContextCommonMock,
312
- "pageId": "terms.ftl"
324
+ pageId: "terms.ftl"
313
325
  }),
314
326
  id<KcContext.LoginDeviceVerifyUserCode>({
315
327
  ...kcContextCommonMock,
316
- "pageId": "login-oauth2-device-verify-user-code.ftl",
328
+ pageId: "login-oauth2-device-verify-user-code.ftl",
317
329
  url: loginUrl
318
330
  }),
319
331
  id<KcContext.LoginOauthGrant>({
320
332
  ...kcContextCommonMock,
321
- "pageId": "login-oauth-grant.ftl",
333
+ pageId: "login-oauth-grant.ftl",
322
334
  oauth: {
323
335
  code: "5-1N4CIzfi1aprIQjmylI-9e3spLCWW9i5d-GDcs-Sw",
324
336
  clientScopesRequested: [
@@ -332,150 +344,152 @@ export const kcContextMocks = [
332
344
  }),
333
345
  id<KcContext.LoginOtp>({
334
346
  ...kcContextCommonMock,
335
- "pageId": "login-otp.ftl",
336
- "otpLogin": {
337
- "userOtpCredentials": [
347
+ pageId: "login-otp.ftl",
348
+ otpLogin: {
349
+ userOtpCredentials: [
338
350
  {
339
- "id": "id1",
340
- "userLabel": "label1"
351
+ id: "id1",
352
+ userLabel: "label1"
341
353
  },
342
354
  {
343
- "id": "id2",
344
- "userLabel": "label2"
355
+ id: "id2",
356
+ userLabel: "label2"
345
357
  }
346
358
  ]
347
359
  }
348
360
  }),
349
361
  id<KcContext.LoginUsername>({
350
362
  ...kcContextCommonMock,
351
- "pageId": "login-username.ftl",
352
- "url": loginUrl,
353
- "realm": {
363
+ pageId: "login-username.ftl",
364
+ url: loginUrl,
365
+ realm: {
354
366
  ...kcContextCommonMock.realm,
355
- "loginWithEmailAllowed": true,
356
- "rememberMe": true,
357
- "password": true,
358
- "resetPasswordAllowed": true,
359
- "registrationAllowed": true
367
+ loginWithEmailAllowed: true,
368
+ rememberMe: true,
369
+ password: true,
370
+ resetPasswordAllowed: true,
371
+ registrationAllowed: true
360
372
  },
361
- "social": {
362
- "displayInfo": true
373
+ social: {
374
+ displayInfo: true
363
375
  },
364
- "usernameHidden": false,
365
- "login": {},
366
- "registrationDisabled": false
376
+ usernameHidden: false,
377
+ login: {},
378
+ registrationDisabled: false
367
379
  }),
368
380
  id<KcContext.LoginPassword>({
369
381
  ...kcContextCommonMock,
370
- "pageId": "login-password.ftl",
371
- "url": loginUrl,
372
- "realm": {
382
+ pageId: "login-password.ftl",
383
+ url: loginUrl,
384
+ realm: {
373
385
  ...kcContextCommonMock.realm,
374
- "resetPasswordAllowed": true
386
+ resetPasswordAllowed: true
375
387
  },
376
- "social": {
377
- "displayInfo": false
388
+ social: {
389
+ displayInfo: false
378
390
  }
379
391
  }),
380
392
  id<KcContext.WebauthnAuthenticate>({
381
393
  ...kcContextCommonMock,
382
- "pageId": "webauthn-authenticate.ftl",
383
- "url": loginUrl,
384
- "authenticators": {
385
- "authenticators": []
394
+ pageId: "webauthn-authenticate.ftl",
395
+ url: loginUrl,
396
+ authenticators: {
397
+ authenticators: []
386
398
  },
387
- "realm": {
399
+ realm: {
388
400
  ...kcContextCommonMock.realm,
389
- "password": true,
390
- "registrationAllowed": true
401
+ password: true,
402
+ registrationAllowed: true
391
403
  },
392
- "challenge": "",
393
- "userVerification": "not specified",
394
- "rpId": "",
395
- "createTimeout": "0",
396
- "isUserIdentified": "false",
397
- "shouldDisplayAuthenticators": false,
398
- "social": {
399
- "displayInfo": false
404
+ challenge: "",
405
+ userVerification: "not specified",
406
+ rpId: "",
407
+ createTimeout: "0",
408
+ isUserIdentified: "false",
409
+ shouldDisplayAuthenticators: false,
410
+ social: {
411
+ displayInfo: false
400
412
  },
401
- "login": {}
413
+ login: {}
402
414
  }),
403
415
  id<KcContext.LoginUpdatePassword>({
404
416
  ...kcContextCommonMock,
405
- "pageId": "login-update-password.ftl"
417
+ pageId: "login-update-password.ftl"
406
418
  }),
407
419
  id<KcContext.LoginUpdateProfile>({
408
420
  ...kcContextCommonMock,
409
- "pageId": "login-update-profile.ftl",
410
- "profile": {
421
+ pageId: "login-update-profile.ftl",
422
+ profile: {
411
423
  attributes,
412
424
  attributesByName
413
425
  }
414
426
  }),
415
427
  id<KcContext.LoginIdpLinkConfirm>({
416
428
  ...kcContextCommonMock,
417
- "pageId": "login-idp-link-confirm.ftl",
418
- "idpAlias": "FranceConnect"
429
+ pageId: "login-idp-link-confirm.ftl",
430
+ idpAlias: "FranceConnect"
419
431
  }),
420
432
  id<KcContext.LoginIdpLinkEmail>({
421
433
  ...kcContextCommonMock,
422
- "pageId": "login-idp-link-email.ftl",
423
- "idpAlias": "FranceConnect",
424
- "brokerContext": {
425
- "username": "anUsername"
434
+ pageId: "login-idp-link-email.ftl",
435
+ idpAlias: "FranceConnect",
436
+ brokerContext: {
437
+ username: "anUsername"
426
438
  }
427
439
  }),
428
440
  id<KcContext.LoginConfigTotp>({
429
441
  ...kcContextCommonMock,
430
- "pageId": "login-config-totp.ftl",
431
- "totp": {
432
- "totpSecretEncoded": "KVVF G2BY N4YX S6LB IUYT K2LH IFYE 4SBV",
433
- "qrUrl": "#",
434
- "totpSecretQrCode":
442
+ pageId: "login-config-totp.ftl",
443
+ totp: {
444
+ totpSecretEncoded: "KVVF G2BY N4YX S6LB IUYT K2LH IFYE 4SBV",
445
+ qrUrl: "#",
446
+ totpSecretQrCode:
435
447
  "iVBORw0KGgoAAAANSUhEUgAAAPYAAAD2AQAAAADNaUdlAAACM0lEQVR4Xu3OIZJgOQwDUDFd2UxiurLAVnnbHw4YGDKtSiWOn4Gxf81//7r/+q8b4HfLGBZDK9d85NmNR+sB42sXvOYrN5P1DcgYYFTGfOlbzE8gzwy3euweGizw7cfdl34/GRhlkxjKNV+5AebPXPORX1JuB9x8ZfbyyD2y1krWAKsbMq1HnqQDaLfa77p4+MqvzEGSqvSAD/2IHW2yHaigR9tX3m8dDIYGcNf3f+gDpVBZbZU77zyJ6Rlcy+qoTMG887KAPD9hsh6a1Sv3gJUHGHUAxSMzj7zqDDe7Phmt2eG+8UsMxjRGm816MAO+8VMl1R1jGHOrZB/5Zo/WXAPgxixm9Mo96vDGrM1eOto8c4Ax4wF437mifOXlpiPzCnN7Y9l95NnEMxgMY9AAGA8fucH14Y1aVb6N/cqrmyh0BVht7k1e+bU8LK0Cg5vmVq9c5vHIjOfqxDIfeTraNVTwewa4wVe+SW5N+uP1qACeudUZbqGOfA6VZV750Noq2Xx3kpveV44ZelSV1V7KFHzkWyVrrlUwG0Pl9pWnoy3vsQoME6vKI69i5osVgwWzHT7zjmJtMcNUSVn1oYMd7ZodbgowZl45VG0uVuLPUr1yc79uaQBag/mqR34xhlWyHm1prplHboCWdZ4TeZjsK8+dI+jbz1C5hl65mcpgB5dhcj8+dGO+0Ko68+lD37JDD83dpDLzzK+TrQyaVwGj6pUboGV+7+AyN8An/pf84/7rv/4/1l4OCc/1BYMAAAAASUVORK5CYII=",
436
- "manualUrl": "#",
437
- "totpSecret": "G4nsI8lQagRMUchH8jEG",
438
- "otpCredentials": [],
439
- "supportedApplications": ["FreeOTP", "Google Authenticator"],
440
- "policy": {
441
- "algorithm": "HmacSHA1",
442
- "digits": 6,
443
- "lookAheadWindow": 1,
444
- "type": "totp",
445
- "period": 30,
446
- "getAlgorithmKey": () => "SHA1"
448
+ manualUrl: "#",
449
+ totpSecret: "G4nsI8lQagRMUchH8jEG",
450
+ otpCredentials: [],
451
+ supportedApplications: ["FreeOTP", "Google Authenticator"],
452
+ policy: {
453
+ algorithm: "HmacSHA1",
454
+ digits: 6,
455
+ lookAheadWindow: 1,
456
+ type: "totp",
457
+ period: 30,
458
+ getAlgorithmKey: () => "SHA1"
447
459
  }
448
460
  }
449
461
  }),
450
462
  id<KcContext.LogoutConfirm>({
451
463
  ...kcContextCommonMock,
452
- "pageId": "logout-confirm.ftl",
453
- "url": {
464
+ pageId: "logout-confirm.ftl",
465
+ url: {
454
466
  ...kcContextCommonMock.url,
455
- "logoutConfirmAction": "Continuer?"
467
+ logoutConfirmAction: "Continuer?"
456
468
  },
457
- "client": {
458
- "clientId": "myApp",
459
- "baseUrl": "#",
460
- "attributes": {}
469
+ client: {
470
+ clientId: "myApp",
471
+ baseUrl: "#",
472
+ attributes: {}
461
473
  },
462
- "logoutConfirm": { "code": "123", skipLink: false }
474
+ logoutConfirm: { code: "123", skipLink: false }
463
475
  }),
464
476
  id<KcContext.IdpReviewUserProfile>({
465
477
  ...kcContextCommonMock,
466
- "pageId": "idp-review-user-profile.ftl",
467
- "profile": {
478
+ pageId: "idp-review-user-profile.ftl",
479
+ profile: {
468
480
  attributes,
469
481
  attributesByName
470
482
  }
471
483
  }),
472
484
  id<KcContext.UpdateEmail>({
473
485
  ...kcContextCommonMock,
474
- "pageId": "update-email.ftl",
475
- "profile": {
476
- "attributes": attributes.filter(attribute => attribute.name === "email"),
477
- "attributesByName": Object.fromEntries(
478
- attributes.filter(attribute => attribute.name === "email").map(attribute => [attribute.name, attribute])
486
+ pageId: "update-email.ftl",
487
+ profile: {
488
+ attributes: attributes.filter(attribute => attribute.name === "email"),
489
+ attributesByName: Object.fromEntries(
490
+ attributes
491
+ .filter(attribute => attribute.name === "email")
492
+ .map(attribute => [attribute.name, attribute])
479
493
  )
480
494
  }
481
495
  }),
@@ -502,8 +516,8 @@ export const kcContextMocks = [
502
516
  id<KcContext.SamlPostForm>({
503
517
  ...kcContextCommonMock,
504
518
  pageId: "saml-post-form.ftl",
505
- "samlPost": {
506
- "url": ""
519
+ samlPost: {
520
+ url: ""
507
521
  }
508
522
  }),
509
523
  id<KcContext.LoginPageExpired>({
@@ -514,107 +528,107 @@ export const kcContextMocks = [
514
528
  id<KcContext.FrontchannelLogout>({
515
529
  ...kcContextCommonMock,
516
530
  pageId: "frontchannel-logout.ftl",
517
- "logout": {
518
- "clients": [
531
+ logout: {
532
+ clients: [
519
533
  {
520
- "name": "myApp",
521
- "frontChannelLogoutUrl": "#"
534
+ name: "myApp",
535
+ frontChannelLogoutUrl: "#"
522
536
  },
523
537
  {
524
- "name": "myApp2",
525
- "frontChannelLogoutUrl": "#"
538
+ name: "myApp2",
539
+ frontChannelLogoutUrl: "#"
526
540
  }
527
541
  ]
528
542
  }
529
543
  }),
530
544
  id<KcContext.WebauthnRegister>({
531
- "pageId": "webauthn-register.ftl",
532
- ...kcContextCommonMock,
533
- "challenge": "random-challenge-string",
534
- "userid": "user123",
535
- "username": "johndoe",
536
- "signatureAlgorithms": ["ES256", "RS256"],
537
- "rpEntityName": "Example Corp",
538
- "rpId": "example.com",
539
- "attestationConveyancePreference": "direct",
540
- "authenticatorAttachment": "platform",
541
- "requireResidentKey": "required",
542
- "userVerificationRequirement": "preferred",
543
- "createTimeout": 60000,
544
- "excludeCredentialIds": "credId123,credId456",
545
- "isSetRetry": false,
546
- "isAppInitiatedAction": true
545
+ pageId: "webauthn-register.ftl",
546
+ ...kcContextCommonMock,
547
+ challenge: "random-challenge-string",
548
+ userid: "user123",
549
+ username: "johndoe",
550
+ signatureAlgorithms: ["ES256", "RS256"],
551
+ rpEntityName: "Example Corp",
552
+ rpId: "example.com",
553
+ attestationConveyancePreference: "direct",
554
+ authenticatorAttachment: "platform",
555
+ requireResidentKey: "required",
556
+ userVerificationRequirement: "preferred",
557
+ createTimeout: 60000,
558
+ excludeCredentialIds: "credId123,credId456",
559
+ isSetRetry: false,
560
+ isAppInitiatedAction: true
547
561
  }),
548
562
  id<KcContext.DeleteCredential>({
549
- "pageId": "delete-credential.ftl",
563
+ pageId: "delete-credential.ftl",
550
564
  ...kcContextCommonMock,
551
- "credentialLabel": "myCredential"
565
+ credentialLabel: "myCredential"
552
566
  }),
553
567
  id<KcContext.Code>({
554
- "pageId": "code.ftl",
568
+ pageId: "code.ftl",
555
569
  ...kcContextCommonMock,
556
- "code": {
557
- "success": true,
558
- "code": "123456"
570
+ code: {
571
+ success: true,
572
+ code: "123456"
559
573
  }
560
574
  }),
561
575
  id<KcContext.DeleteAccountConfirm>({
562
- "pageId": "delete-account-confirm.ftl",
576
+ pageId: "delete-account-confirm.ftl",
563
577
  ...kcContextCommonMock,
564
- "triggered_from_aia": true
578
+ triggered_from_aia: true
565
579
  }),
566
580
  id<KcContext.LoginRecoveryAuthnCodeConfig>({
567
- "pageId": "login-recovery-authn-code-config.ftl",
581
+ pageId: "login-recovery-authn-code-config.ftl",
568
582
  ...kcContextCommonMock,
569
- "recoveryAuthnCodesConfigBean": {
570
- "generatedRecoveryAuthnCodesList": ["code123", "code456", "code789"],
571
- "generatedRecoveryAuthnCodesAsString": "code123, code456, code789",
572
- "generatedAt": new Date().getTime()
583
+ recoveryAuthnCodesConfigBean: {
584
+ generatedRecoveryAuthnCodesList: ["code123", "code456", "code789"],
585
+ generatedRecoveryAuthnCodesAsString: "code123, code456, code789",
586
+ generatedAt: new Date().getTime()
573
587
  }
574
588
  }),
575
589
  id<KcContext.LoginRecoveryAuthnCodeInput>({
576
- "pageId": "login-recovery-authn-code-input.ftl",
590
+ pageId: "login-recovery-authn-code-input.ftl",
577
591
  ...kcContextCommonMock,
578
- "recoveryAuthnCodesInputBean": {
579
- "codeNumber": 1234
592
+ recoveryAuthnCodesInputBean: {
593
+ codeNumber: 1234
580
594
  }
581
595
  }),
582
596
  id<KcContext.LoginResetOtp>({
583
- "pageId": "login-reset-otp.ftl",
597
+ pageId: "login-reset-otp.ftl",
584
598
  ...kcContextCommonMock,
585
- "configuredOtpCredentials": {
586
- "userOtpCredentials": [
599
+ configuredOtpCredentials: {
600
+ userOtpCredentials: [
587
601
  {
588
- "id": "otpId1",
589
- "userLabel": "OTP Device 1"
602
+ id: "otpId1",
603
+ userLabel: "OTP Device 1"
590
604
  },
591
605
  {
592
- "id": "otpId2",
593
- "userLabel": "OTP Device 2"
606
+ id: "otpId2",
607
+ userLabel: "OTP Device 2"
594
608
  },
595
609
  {
596
- "id": "otpId3",
597
- "userLabel": "Backup OTP"
610
+ id: "otpId3",
611
+ userLabel: "Backup OTP"
598
612
  }
599
613
  ],
600
- "selectedCredentialId": "otpId2"
614
+ selectedCredentialId: "otpId2"
601
615
  }
602
616
  }),
603
617
  id<KcContext.LoginX509Info>({
604
- "pageId": "login-x509-info.ftl",
618
+ pageId: "login-x509-info.ftl",
605
619
  ...kcContextCommonMock,
606
- "x509": {
607
- "formData": {
608
- "subjectDN": "CN=John Doe, O=Example Corp, C=US",
609
- "isUserEnabled": true,
610
- "username": "johndoe"
620
+ x509: {
621
+ formData: {
622
+ subjectDN: "CN=John Doe, O=Example Corp, C=US",
623
+ isUserEnabled: true,
624
+ username: "johndoe"
611
625
  }
612
626
  }
613
627
  }),
614
628
  id<KcContext.WebauthnError>({
615
- "pageId": "webauthn-error.ftl",
629
+ pageId: "webauthn-error.ftl",
616
630
  ...kcContextCommonMock,
617
- "isAppInitiatedAction": true
631
+ isAppInitiatedAction: true
618
632
  })
619
633
  ];
620
634