keycloakify 4.2.13 → 4.2.14-beta.0
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/build-keycloak-theme/generateFtl/common.ftl +30 -57
- package/bin/build-keycloak-theme/generateFtl/generateFtl.js +1 -1
- package/bin/build-keycloak-theme/generateFtl/generateFtl.js.map +1 -1
- package/package.json +1 -1
- package/src/bin/build-keycloak-theme/generateFtl/common.ftl +30 -57
- package/src/bin/build-keycloak-theme/generateFtl/generateFtl.ts +3 -1
@@ -1,7 +1,6 @@
|
|
1
|
-
<script>const _=
|
2
|
-
<#macro objectToJson_please_ignore_errors object depth>
|
1
|
+
<script>const _=
|
2
|
+
<#macro objectToJson_please_ignore_errors object depth arr ftl>
|
3
3
|
<@compress>
|
4
|
-
|
5
4
|
<#local isHash = false>
|
6
5
|
<#attempt>
|
7
6
|
<#local isHash = object?is_hash || object?is_hash_ex>
|
@@ -11,9 +10,7 @@
|
|
11
10
|
<#return>
|
12
11
|
</#attempt>
|
13
12
|
<#if isHash>
|
14
|
-
|
15
13
|
<#local keys = "">
|
16
|
-
|
17
14
|
<#attempt>
|
18
15
|
<#local keys = object?keys>
|
19
16
|
<#recover>
|
@@ -21,41 +18,42 @@
|
|
21
18
|
undefined
|
22
19
|
<#return>
|
23
20
|
</#attempt>
|
24
|
-
|
21
|
+
<#if arr?sequence?size gte 1>
|
22
|
+
<#local keys = arr>
|
23
|
+
</#if>
|
25
24
|
{${'\n'}
|
26
|
-
|
27
25
|
<#list keys as key>
|
28
|
-
|
29
26
|
<#if key == "class">
|
30
27
|
/* skipping "class" property of object */
|
31
28
|
<#continue>
|
32
29
|
</#if>
|
33
|
-
|
34
|
-
<#local value = "">
|
35
|
-
|
36
30
|
<#attempt>
|
37
|
-
<#local value = object[key]>
|
31
|
+
<#local value = object[key]!"error_data_is_undefined">
|
38
32
|
<#recover>
|
39
33
|
/* couldn't dereference ${key} of object */
|
40
34
|
<#continue>
|
41
35
|
</#attempt>
|
42
|
-
|
43
36
|
<#if depth gt 7>
|
44
37
|
/* Avoid calling recustively too many times depth: ${depth}, key: ${key} */
|
45
38
|
<#continue>
|
46
39
|
</#if>
|
47
|
-
|
48
|
-
|
49
|
-
|
40
|
+
<#local arr_keys = []>
|
41
|
+
<#if depth==0 && key=="url" && ftl=="saml-post-form.ftl" >
|
42
|
+
<#local arr_keys = ["resourcesPath", "resourcesCommonPath", "loginRestartFlowUrl", "loginUrl", "loginResetCredentialsUrl", "registrationUrl", "registrationAction", "oauth2DeviceVerificationAction", "oauthAction", "loginResetCredentialsUrl"]>
|
43
|
+
<#elseif depth==0 && key=="url">
|
44
|
+
<#local arr_keys = ["loginAction", "resourcesPath", "resourcesCommonPath", "loginRestartFlowUrl", "loginUrl", "loginResetCredentialsUrl", "registrationUrl", "registrationAction", "oauth2DeviceVerificationAction", "oauthAction", "loginResetCredentialsUrl"]>
|
45
|
+
</#if>
|
46
|
+
<#if depth==0 && key=="auth" && ftl=="login-reset-password.ftl" >
|
47
|
+
<#local arr_keys = ["showUsername", "showResetCredentials", "showTryAnotherWayLink", "attemptedUsername"]>
|
48
|
+
<#elseif depth==0 && key=="auth">
|
49
|
+
<#local arr_keys = ["showUsername", "showResetCredentials", "showTryAnotherWayLink"]>
|
50
|
+
</#if>
|
51
|
+
<#if depth==0 && key=="updateProfileCtx" ><#continue></#if>
|
52
|
+
"${key}": <@objectToJson_please_ignore_errors object=value depth=depth+1 arr=arr_keys ftl=ftl />,
|
50
53
|
</#list>
|
51
|
-
|
52
54
|
}${'\n'}
|
53
|
-
|
54
55
|
<#return>
|
55
|
-
|
56
56
|
</#if>
|
57
|
-
|
58
|
-
|
59
57
|
<#local isMethod = "">
|
60
58
|
<#attempt>
|
61
59
|
<#local isMethod = object?is_method>
|
@@ -64,14 +62,10 @@
|
|
64
62
|
undefined
|
65
63
|
<#return>
|
66
64
|
</#attempt>
|
67
|
-
|
68
65
|
<#if isMethod>
|
69
66
|
undefined
|
70
67
|
<#return>
|
71
68
|
</#if>
|
72
|
-
|
73
|
-
|
74
|
-
|
75
69
|
<#local isBoolean = "">
|
76
70
|
<#attempt>
|
77
71
|
<#local isBoolean = object?is_boolean>
|
@@ -80,13 +74,10 @@
|
|
80
74
|
undefined
|
81
75
|
<#return>
|
82
76
|
</#attempt>
|
83
|
-
|
84
77
|
<#if isBoolean>
|
85
78
|
${object?c}
|
86
79
|
<#return>
|
87
80
|
</#if>
|
88
|
-
|
89
|
-
|
90
81
|
<#local isEnumerable = "">
|
91
82
|
<#attempt>
|
92
83
|
<#local isEnumerable = object?is_enumerable>
|
@@ -95,23 +86,14 @@
|
|
95
86
|
undefined
|
96
87
|
<#return>
|
97
88
|
</#attempt>
|
98
|
-
|
99
89
|
<#if isEnumerable>
|
100
|
-
|
101
90
|
[${'\n'}
|
102
|
-
|
103
91
|
<#list object as item>
|
104
|
-
|
105
|
-
<@objectToJson_please_ignore_errors object=item depth=depth+1/>,
|
106
|
-
|
92
|
+
<@objectToJson_please_ignore_errors object=item depth=depth+1 arr=[] ftl=ftl/>,
|
107
93
|
</#list>
|
108
|
-
|
109
94
|
]${'\n'}
|
110
|
-
|
111
95
|
<#return>
|
112
96
|
</#if>
|
113
|
-
|
114
|
-
|
115
97
|
<#attempt>
|
116
98
|
"${object?replace('"', '\\"')?no_esc}"
|
117
99
|
<#recover>
|
@@ -119,25 +101,21 @@
|
|
119
101
|
undefined;
|
120
102
|
<#return>
|
121
103
|
</#attempt>
|
122
|
-
|
123
|
-
|
124
104
|
</@compress>
|
125
105
|
</#macro>
|
126
|
-
|
127
106
|
(()=>{
|
128
|
-
|
129
|
-
const nonAutomaticallyConvertible = {
|
107
|
+
const nonAutomaticallyConvertible = {
|
130
108
|
"messagesPerField": {
|
131
|
-
|
132
|
-
<#assign
|
133
|
-
|
109
|
+
<#assign fieldNames = ["global", "userLabel", "username", "email", "firstName", "lastName", "password", "password-confirm", "totp", "totpSecret", "SAMLRequest", "SAMLResponse", "relayState", "device_user_code", "code", "password-new", "rememberMe", "login", "authenticationExecution", "cancel-aia", "clientDataJSON", "authenticatorData", "signature", "credentialId", "userHandle", "error", "authn_use_chk", "authenticationExecution", "isSetRetry", "try-again", "attestationObject", "publicKeyCredentialId", "authenticatorLabel"]>
|
110
|
+
<#assign attributes = (profile.attributes)![]>
|
134
111
|
<#attempt>
|
135
|
-
<#list
|
136
|
-
<#
|
112
|
+
<#list attributes as attribute>
|
113
|
+
<#if (attribute.name)??>
|
114
|
+
<#assign fieldNames += [attribute.name]>
|
115
|
+
</#if>
|
137
116
|
</#list>
|
138
117
|
<#recover>
|
139
118
|
</#attempt>
|
140
|
-
|
141
119
|
"printIfExists": function (fieldName, x) {
|
142
120
|
<#list fieldNames as fieldName>
|
143
121
|
if(fieldName === "${fieldName}" ){
|
@@ -185,24 +163,19 @@
|
|
185
163
|
throw new Error("There is no " + fieldName + " field");
|
186
164
|
}
|
187
165
|
},
|
188
|
-
"msg": function(){ throw new Error("use import { useKcMessage
|
189
|
-
"advancedMsg": function(){ throw new Error("use import { useKcMessage
|
166
|
+
"msg": function(){ throw new Error("use import { useKcMessage } from 'keycloakify'"); },
|
167
|
+
"advancedMsg": function(){ throw new Error("use import { useKcMessage } from 'keycloakify'"); }
|
190
168
|
};
|
191
|
-
|
192
169
|
const out = {};
|
193
|
-
|
194
170
|
Object.deepAssign(
|
195
171
|
out,
|
196
172
|
//Removing all the undefined
|
197
|
-
JSON.parse(JSON.stringify(<@objectToJson_please_ignore_errors object=.data_model depth=0 />))
|
173
|
+
JSON.parse(JSON.stringify(<@objectToJson_please_ignore_errors object=.data_model depth=0 arr=[] ftl="ftl_template_for_replacement" />), (key, value) => value === "error_data_is_undefined" ? undefined : value)
|
198
174
|
);
|
199
|
-
|
200
175
|
Object.deepAssign(
|
201
176
|
out,
|
202
177
|
nonAutomaticallyConvertible
|
203
178
|
);
|
204
|
-
|
205
179
|
return out;
|
206
|
-
|
207
180
|
})()
|
208
181
|
</script>
|
@@ -149,7 +149,7 @@ function generateFtlFilesCodeFactory(params) {
|
|
149
149
|
" );",
|
150
150
|
"</script>",
|
151
151
|
].join("\n"));
|
152
|
-
(0, objectKeys_1.objectKeys)(ftlPlaceholders).forEach(function (id) { return (ftlCode = ftlCode.replace(id, ftlPlaceholders[id])); });
|
152
|
+
(0, objectKeys_1.objectKeys)(ftlPlaceholders).forEach(function (id) { return (ftlCode = ftlCode.replace(id, ftlPlaceholders[id]).replace("ftl_template_for_replacement", pageId)); });
|
153
153
|
return { ftlCode: ftlCode };
|
154
154
|
}
|
155
155
|
return { generateFtlFilesCode: generateFtlFilesCode };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generateFtl.js","sourceRoot":"","sources":["../../../src/bin/build-keycloak-theme/generateFtl/generateFtl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,sEAA6I;AAC7I,0CAAoB;AACpB,6BAAwC;AACxC,+CAA8C;AAC9C,8DAA6D;AAEhD,QAAA,OAAO,GAAG;IACnB,WAAW;IACX,cAAc;IACd,2BAA2B;IAC3B,UAAU;IACV,WAAW;IACX,0BAA0B;IAC1B,wBAAwB;IACxB,WAAW;IACX,eAAe;IACf,0BAA0B;IAC1B,4BAA4B;CACtB,CAAC;AAIX,SAAS,gBAAgB,CAAC,YAAoB;IAC1C,OAAO,YAAE,CAAC,YAAY,CAAC,IAAA,WAAQ,EAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/E,CAAC;AAED,SAAgB,2BAA2B,CAAC,MAK3C;IACW,IAAA,kBAAkB,GAA4C,MAAM,mBAAlD,EAAE,aAAa,GAA6B,MAAM,cAAnC,EAAE,WAAW,GAAgB,MAAM,YAAtB,EAAE,SAAS,GAAK,MAAM,UAAX,CAAY;IAE7E,IAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAEtC,CAAC,CAAC,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@
|
|
1
|
-
<script>const _=
|
2
|
-
<#macro objectToJson_please_ignore_errors object depth>
|
1
|
+
<script>const _=
|
2
|
+
<#macro objectToJson_please_ignore_errors object depth arr ftl>
|
3
3
|
<@compress>
|
4
|
-
|
5
4
|
<#local isHash = false>
|
6
5
|
<#attempt>
|
7
6
|
<#local isHash = object?is_hash || object?is_hash_ex>
|
@@ -11,9 +10,7 @@
|
|
11
10
|
<#return>
|
12
11
|
</#attempt>
|
13
12
|
<#if isHash>
|
14
|
-
|
15
13
|
<#local keys = "">
|
16
|
-
|
17
14
|
<#attempt>
|
18
15
|
<#local keys = object?keys>
|
19
16
|
<#recover>
|
@@ -21,41 +18,42 @@
|
|
21
18
|
undefined
|
22
19
|
<#return>
|
23
20
|
</#attempt>
|
24
|
-
|
21
|
+
<#if arr?sequence?size gte 1>
|
22
|
+
<#local keys = arr>
|
23
|
+
</#if>
|
25
24
|
{${'\n'}
|
26
|
-
|
27
25
|
<#list keys as key>
|
28
|
-
|
29
26
|
<#if key == "class">
|
30
27
|
/* skipping "class" property of object */
|
31
28
|
<#continue>
|
32
29
|
</#if>
|
33
|
-
|
34
|
-
<#local value = "">
|
35
|
-
|
36
30
|
<#attempt>
|
37
|
-
<#local value = object[key]>
|
31
|
+
<#local value = object[key]!"error_data_is_undefined">
|
38
32
|
<#recover>
|
39
33
|
/* couldn't dereference ${key} of object */
|
40
34
|
<#continue>
|
41
35
|
</#attempt>
|
42
|
-
|
43
36
|
<#if depth gt 7>
|
44
37
|
/* Avoid calling recustively too many times depth: ${depth}, key: ${key} */
|
45
38
|
<#continue>
|
46
39
|
</#if>
|
47
|
-
|
48
|
-
|
49
|
-
|
40
|
+
<#local arr_keys = []>
|
41
|
+
<#if depth==0 && key=="url" && ftl=="saml-post-form.ftl" >
|
42
|
+
<#local arr_keys = ["resourcesPath", "resourcesCommonPath", "loginRestartFlowUrl", "loginUrl", "loginResetCredentialsUrl", "registrationUrl", "registrationAction", "oauth2DeviceVerificationAction", "oauthAction", "loginResetCredentialsUrl"]>
|
43
|
+
<#elseif depth==0 && key=="url">
|
44
|
+
<#local arr_keys = ["loginAction", "resourcesPath", "resourcesCommonPath", "loginRestartFlowUrl", "loginUrl", "loginResetCredentialsUrl", "registrationUrl", "registrationAction", "oauth2DeviceVerificationAction", "oauthAction", "loginResetCredentialsUrl"]>
|
45
|
+
</#if>
|
46
|
+
<#if depth==0 && key=="auth" && ftl=="login-reset-password.ftl" >
|
47
|
+
<#local arr_keys = ["showUsername", "showResetCredentials", "showTryAnotherWayLink", "attemptedUsername"]>
|
48
|
+
<#elseif depth==0 && key=="auth">
|
49
|
+
<#local arr_keys = ["showUsername", "showResetCredentials", "showTryAnotherWayLink"]>
|
50
|
+
</#if>
|
51
|
+
<#if depth==0 && key=="updateProfileCtx" ><#continue></#if>
|
52
|
+
"${key}": <@objectToJson_please_ignore_errors object=value depth=depth+1 arr=arr_keys ftl=ftl />,
|
50
53
|
</#list>
|
51
|
-
|
52
54
|
}${'\n'}
|
53
|
-
|
54
55
|
<#return>
|
55
|
-
|
56
56
|
</#if>
|
57
|
-
|
58
|
-
|
59
57
|
<#local isMethod = "">
|
60
58
|
<#attempt>
|
61
59
|
<#local isMethod = object?is_method>
|
@@ -64,14 +62,10 @@
|
|
64
62
|
undefined
|
65
63
|
<#return>
|
66
64
|
</#attempt>
|
67
|
-
|
68
65
|
<#if isMethod>
|
69
66
|
undefined
|
70
67
|
<#return>
|
71
68
|
</#if>
|
72
|
-
|
73
|
-
|
74
|
-
|
75
69
|
<#local isBoolean = "">
|
76
70
|
<#attempt>
|
77
71
|
<#local isBoolean = object?is_boolean>
|
@@ -80,13 +74,10 @@
|
|
80
74
|
undefined
|
81
75
|
<#return>
|
82
76
|
</#attempt>
|
83
|
-
|
84
77
|
<#if isBoolean>
|
85
78
|
${object?c}
|
86
79
|
<#return>
|
87
80
|
</#if>
|
88
|
-
|
89
|
-
|
90
81
|
<#local isEnumerable = "">
|
91
82
|
<#attempt>
|
92
83
|
<#local isEnumerable = object?is_enumerable>
|
@@ -95,23 +86,14 @@
|
|
95
86
|
undefined
|
96
87
|
<#return>
|
97
88
|
</#attempt>
|
98
|
-
|
99
89
|
<#if isEnumerable>
|
100
|
-
|
101
90
|
[${'\n'}
|
102
|
-
|
103
91
|
<#list object as item>
|
104
|
-
|
105
|
-
<@objectToJson_please_ignore_errors object=item depth=depth+1/>,
|
106
|
-
|
92
|
+
<@objectToJson_please_ignore_errors object=item depth=depth+1 arr=[] ftl=ftl/>,
|
107
93
|
</#list>
|
108
|
-
|
109
94
|
]${'\n'}
|
110
|
-
|
111
95
|
<#return>
|
112
96
|
</#if>
|
113
|
-
|
114
|
-
|
115
97
|
<#attempt>
|
116
98
|
"${object?replace('"', '\\"')?no_esc}"
|
117
99
|
<#recover>
|
@@ -119,25 +101,21 @@
|
|
119
101
|
undefined;
|
120
102
|
<#return>
|
121
103
|
</#attempt>
|
122
|
-
|
123
|
-
|
124
104
|
</@compress>
|
125
105
|
</#macro>
|
126
|
-
|
127
106
|
(()=>{
|
128
|
-
|
129
|
-
const nonAutomaticallyConvertible = {
|
107
|
+
const nonAutomaticallyConvertible = {
|
130
108
|
"messagesPerField": {
|
131
|
-
|
132
|
-
<#assign
|
133
|
-
|
109
|
+
<#assign fieldNames = ["global", "userLabel", "username", "email", "firstName", "lastName", "password", "password-confirm", "totp", "totpSecret", "SAMLRequest", "SAMLResponse", "relayState", "device_user_code", "code", "password-new", "rememberMe", "login", "authenticationExecution", "cancel-aia", "clientDataJSON", "authenticatorData", "signature", "credentialId", "userHandle", "error", "authn_use_chk", "authenticationExecution", "isSetRetry", "try-again", "attestationObject", "publicKeyCredentialId", "authenticatorLabel"]>
|
110
|
+
<#assign attributes = (profile.attributes)![]>
|
134
111
|
<#attempt>
|
135
|
-
<#list
|
136
|
-
<#
|
112
|
+
<#list attributes as attribute>
|
113
|
+
<#if (attribute.name)??>
|
114
|
+
<#assign fieldNames += [attribute.name]>
|
115
|
+
</#if>
|
137
116
|
</#list>
|
138
117
|
<#recover>
|
139
118
|
</#attempt>
|
140
|
-
|
141
119
|
"printIfExists": function (fieldName, x) {
|
142
120
|
<#list fieldNames as fieldName>
|
143
121
|
if(fieldName === "${fieldName}" ){
|
@@ -185,24 +163,19 @@
|
|
185
163
|
throw new Error("There is no " + fieldName + " field");
|
186
164
|
}
|
187
165
|
},
|
188
|
-
"msg": function(){ throw new Error("use import { useKcMessage
|
189
|
-
"advancedMsg": function(){ throw new Error("use import { useKcMessage
|
166
|
+
"msg": function(){ throw new Error("use import { useKcMessage } from 'keycloakify'"); },
|
167
|
+
"advancedMsg": function(){ throw new Error("use import { useKcMessage } from 'keycloakify'"); }
|
190
168
|
};
|
191
|
-
|
192
169
|
const out = {};
|
193
|
-
|
194
170
|
Object.deepAssign(
|
195
171
|
out,
|
196
172
|
//Removing all the undefined
|
197
|
-
JSON.parse(JSON.stringify(<@objectToJson_please_ignore_errors object=.data_model depth=0 />))
|
173
|
+
JSON.parse(JSON.stringify(<@objectToJson_please_ignore_errors object=.data_model depth=0 arr=[] ftl="ftl_template_for_replacement" />), (key, value) => value === "error_data_is_undefined" ? undefined : value)
|
198
174
|
);
|
199
|
-
|
200
175
|
Object.deepAssign(
|
201
176
|
out,
|
202
177
|
nonAutomaticallyConvertible
|
203
178
|
);
|
204
|
-
|
205
179
|
return out;
|
206
|
-
|
207
180
|
})()
|
208
181
|
</script>
|
@@ -141,7 +141,9 @@ export function generateFtlFilesCodeFactory(params: {
|
|
141
141
|
].join("\n"),
|
142
142
|
);
|
143
143
|
|
144
|
-
objectKeys(ftlPlaceholders).forEach(
|
144
|
+
objectKeys(ftlPlaceholders).forEach(
|
145
|
+
id => (ftlCode = ftlCode.replace(id, ftlPlaceholders[id]).replace("ftl_template_for_replacement", pageId)),
|
146
|
+
);
|
145
147
|
|
146
148
|
return { ftlCode };
|
147
149
|
}
|