keycloakify 10.0.0-rc.46 → 10.0.0-rc.48

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.
package/bin/3.index.js CHANGED
@@ -1129,24 +1129,10 @@ async function buildJar(params) {
1129
1129
  const { jarFileBasename, keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion, resourcesDirPath, buildContext } = params;
1130
1130
  const keycloakifyBuildTmpDirPath = (0,external_path_.join)(buildContext.cacheDirPath, jarFileBasename.replace(".jar", ""));
1131
1131
  (0,fs_rmSync/* rmSync */.a)(keycloakifyBuildTmpDirPath, { recursive: true, force: true });
1132
- {
1133
- const transformCodebase_common = (params) => {
1134
- const { fileRelativePath, sourceCode } = params;
1135
- if (fileRelativePath ===
1136
- (0,shared_metaInfKeycloakThemes/* getMetaInfKeycloakThemesJsonFilePath */.KQ)({ resourcesDirPath: "." })) {
1137
- return { modifiedSourceCode: sourceCode };
1138
- }
1139
- for (const themeName of [...buildContext.themeNames, constants/* accountV1ThemeName */.y_]) {
1140
- if ((0,isInside/* isInside */.V)({
1141
- dirPath: (0,external_path_.join)("theme", themeName),
1142
- filePath: fileRelativePath
1143
- })) {
1144
- return { modifiedSourceCode: sourceCode };
1145
- }
1146
- }
1147
- return undefined;
1148
- };
1149
- const transformCodebase_patchForUsingBuiltinAccountV1 = keycloakAccountV1Version !== null
1132
+ (0,transformCodebase/* transformCodebase */.N)({
1133
+ srcDirPath: resourcesDirPath,
1134
+ destDirPath: (0,external_path_.join)(keycloakifyBuildTmpDirPath, "src", "main", "resources"),
1135
+ transformSourceCode: keycloakAccountV1Version !== null
1150
1136
  ? undefined
1151
1137
  : (params) => {
1152
1138
  const { fileRelativePath, sourceCode } = params;
@@ -1178,23 +1164,8 @@ async function buildJar(params) {
1178
1164
  }
1179
1165
  }
1180
1166
  return { modifiedSourceCode: sourceCode };
1181
- };
1182
- (0,transformCodebase/* transformCodebase */.N)({
1183
- srcDirPath: resourcesDirPath,
1184
- destDirPath: (0,external_path_.join)(keycloakifyBuildTmpDirPath, "src", "main", "resources"),
1185
- transformSourceCode: params => {
1186
- const resultCommon = transformCodebase_common(params);
1187
- if (transformCodebase_patchForUsingBuiltinAccountV1 === undefined) {
1188
- return resultCommon;
1189
- }
1190
- if (resultCommon === undefined) {
1191
- return undefined;
1192
- }
1193
- const { modifiedSourceCode } = resultCommon;
1194
- return transformCodebase_patchForUsingBuiltinAccountV1(Object.assign(Object.assign({}, params), { sourceCode: modifiedSourceCode }));
1195
1167
  }
1196
- });
1197
- }
1168
+ });
1198
1169
  route_legacy_pages: {
1199
1170
  // NOTE: If there's no account theme there is no special target for keycloak 24 and up so we create
1200
1171
  // the pages anyway. If there is an account pages, since we know that account-v1 is only support keycloak
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "10.0.0-rc.46",
3
+ "version": "10.0.0-rc.48",
4
4
  "description": "Create Keycloak themes using React",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,35 +50,10 @@ export async function buildJar(params: {
50
50
 
51
51
  rmSync(keycloakifyBuildTmpDirPath, { recursive: true, force: true });
52
52
 
53
- {
54
- const transformCodebase_common = (params: {
55
- fileRelativePath: string;
56
- sourceCode: Buffer;
57
- }): { modifiedSourceCode: Buffer } | undefined => {
58
- const { fileRelativePath, sourceCode } = params;
59
-
60
- if (
61
- fileRelativePath ===
62
- getMetaInfKeycloakThemesJsonFilePath({ resourcesDirPath: "." })
63
- ) {
64
- return { modifiedSourceCode: sourceCode };
65
- }
66
-
67
- for (const themeName of [...buildContext.themeNames, accountV1ThemeName]) {
68
- if (
69
- isInside({
70
- dirPath: pathJoin("theme", themeName),
71
- filePath: fileRelativePath
72
- })
73
- ) {
74
- return { modifiedSourceCode: sourceCode };
75
- }
76
- }
77
-
78
- return undefined;
79
- };
80
-
81
- const transformCodebase_patchForUsingBuiltinAccountV1 =
53
+ transformCodebase({
54
+ srcDirPath: resourcesDirPath,
55
+ destDirPath: pathJoin(keycloakifyBuildTmpDirPath, "src", "main", "resources"),
56
+ transformSourceCode:
82
57
  keycloakAccountV1Version !== null
83
58
  ? undefined
84
59
  : (params: {
@@ -145,31 +120,8 @@ export async function buildJar(params: {
145
120
  }
146
121
 
147
122
  return { modifiedSourceCode: sourceCode };
148
- };
149
-
150
- transformCodebase({
151
- srcDirPath: resourcesDirPath,
152
- destDirPath: pathJoin(keycloakifyBuildTmpDirPath, "src", "main", "resources"),
153
- transformSourceCode: params => {
154
- const resultCommon = transformCodebase_common(params);
155
-
156
- if (transformCodebase_patchForUsingBuiltinAccountV1 === undefined) {
157
- return resultCommon;
158
- }
159
-
160
- if (resultCommon === undefined) {
161
- return undefined;
162
- }
163
-
164
- const { modifiedSourceCode } = resultCommon;
165
-
166
- return transformCodebase_patchForUsingBuiltinAccountV1({
167
- ...params,
168
- sourceCode: modifiedSourceCode
169
- });
170
- }
171
- });
172
- }
123
+ }
124
+ });
173
125
 
174
126
  route_legacy_pages: {
175
127
  // NOTE: If there's no account theme there is no special target for keycloak 24 and up so we create
@@ -184,6 +184,28 @@ try {
184
184
  };
185
185
  </#if>
186
186
 
187
+ attributes_to_attributesByName: {
188
+
189
+ if( !out["profile"] ){
190
+ break attributes_to_attributesByName;
191
+ }
192
+
193
+ if( !out["profile"]["attributes"] ){
194
+ break attributes_to_attributesByName;
195
+ }
196
+
197
+ var attributes = out["profile"]["attributes"];
198
+
199
+ delete out["profile"]["attributes"];
200
+
201
+ out["profile"]["attributesByName"] = {};
202
+
203
+ attributes.forEach(function(attribute){
204
+ out["profile"]["attributesByName"][attribute.name] = attribute;
205
+ });
206
+
207
+ }
208
+
187
209
  return out;
188
210
 
189
211
  function decodeHtmlEntities(htmlStr){
@@ -287,8 +309,8 @@ function decodeHtmlEntities(htmlStr){
287
309
  key == "realmAttributes" &&
288
310
  are_same_path(path, [])
289
311
  ) || (
290
- <#-- attributesByName adds a lot of noise to the output and is not needed -->
291
- key == "attributes" &&
312
+ <#-- attributesByName adds a lot of noise to the output and is not needed, we already have profile.attributes -->
313
+ key == "attributesByName" &&
292
314
  are_same_path(path, ["profile"])
293
315
  ) || (
294
316
  <#-- We already have the attributes in profile speedup the rendering by filtering it out from the register object -->