keycloakify 8.0.0 → 9.0.0-rc.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/README.md +14 -54
- package/account/kcContext/KcContext.js.map +1 -1
- package/account/kcContext/createGetKcContext.js +2 -6
- package/account/kcContext/createGetKcContext.js.map +1 -1
- package/account/kcContext/kcContextMocks.js +4 -3
- package/account/kcContext/kcContextMocks.js.map +1 -1
- package/bin/constants.d.ts +7 -0
- package/bin/constants.js +10 -0
- package/bin/constants.js.map +1 -0
- package/bin/copy-keycloak-resources-to-public.js +34 -22
- package/bin/copy-keycloak-resources-to-public.js.map +1 -1
- package/bin/download-builtin-keycloak-theme.d.ts +4 -1
- package/bin/download-builtin-keycloak-theme.js +8 -6
- package/bin/download-builtin-keycloak-theme.js.map +1 -1
- package/bin/eject-keycloak-page.js +5 -3
- package/bin/eject-keycloak-page.js.map +1 -1
- package/bin/getSrcDirPath.d.ts +1 -1
- package/bin/getSrcDirPath.js +4 -4
- package/bin/getSrcDirPath.js.map +1 -1
- package/bin/initialize-email-theme.js +9 -9
- package/bin/initialize-email-theme.js.map +1 -1
- package/bin/keycloakify/BuildOptions.d.ts +8 -6
- package/bin/keycloakify/BuildOptions.js +63 -71
- package/bin/keycloakify/BuildOptions.js.map +1 -1
- package/bin/keycloakify/generateFtl/generateFtl.d.ts +2 -3
- package/bin/keycloakify/generateFtl/generateFtl.js +3 -4
- package/bin/keycloakify/generateFtl/generateFtl.js.map +1 -1
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountPages.java +33 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountProvider.java +76 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountProviderFactory.java +25 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountSpi.java +50 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/FreeMarkerAccountProvider.java +424 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/FreeMarkerAccountProviderFactory.java +51 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/Templates.java +51 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AccountBean.java +91 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AccountFederatedIdentityBean.java +157 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/ApplicationsBean.java +258 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AuthorizationBean.java +515 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/FeaturesBean.java +56 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/LogBean.java +95 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/PasswordBean.java +34 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/RealmBean.java +75 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/ReferrerBean.java +38 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/SessionsBean.java +93 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/TotpBean.java +125 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/UrlBean.java +121 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/AccountUrls.java +115 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/resources/account/AccountFormService.java +1320 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/resources/account/AccountFormServiceFactory.java +64 -0
- package/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.d.ts +7 -0
- package/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.js +194 -0
- package/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.js.map +1 -0
- package/bin/keycloakify/{generateJavaStackFiles.d.ts → generateJavaStackFiles/generateJavaStackFiles.d.ts} +6 -6
- package/bin/keycloakify/generateJavaStackFiles/generateJavaStackFiles.js +276 -0
- package/bin/keycloakify/generateJavaStackFiles/generateJavaStackFiles.js.map +1 -0
- package/bin/keycloakify/generateJavaStackFiles/index.d.ts +1 -0
- package/bin/keycloakify/generateJavaStackFiles/index.js +18 -0
- package/bin/keycloakify/generateJavaStackFiles/index.js.map +1 -0
- package/bin/keycloakify/generateStartKeycloakTestingContainer.d.ts +1 -3
- package/bin/keycloakify/generateStartKeycloakTestingContainer.js +15 -6
- package/bin/keycloakify/generateStartKeycloakTestingContainer.js.map +1 -1
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.d.ts +5 -2
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.js +11 -8
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.js.map +1 -1
- package/bin/keycloakify/generateTheme/generateMessageProperties.d.ts +1 -1
- package/bin/keycloakify/generateTheme/generateTheme.d.ts +6 -5
- package/bin/keycloakify/generateTheme/generateTheme.js +59 -49
- package/bin/keycloakify/generateTheme/generateTheme.js.map +1 -1
- package/bin/keycloakify/generateTheme/readExtraPageNames.d.ts +1 -1
- package/bin/keycloakify/generateTheme/readExtraPageNames.js.map +1 -1
- package/bin/keycloakify/generateTheme/readFieldNameUsage.d.ts +1 -1
- package/bin/keycloakify/generateTheme/readStaticResourcesUsage.d.ts +1 -1
- package/bin/keycloakify/keycloakify.js +49 -90
- package/bin/keycloakify/keycloakify.js.map +1 -1
- package/bin/keycloakify/parsedPackageJson.d.ts +29 -31
- package/bin/keycloakify/parsedPackageJson.js +7 -8
- package/bin/keycloakify/parsedPackageJson.js.map +1 -1
- package/bin/promptKeycloakVersion.js +1 -1
- package/bin/promptKeycloakVersion.js.map +1 -1
- package/bin/tools/downloadAndUnzip.d.ts +1 -1
- package/bin/tools/downloadAndUnzip.js +24 -26
- package/bin/tools/downloadAndUnzip.js.map +1 -1
- package/bin/tools/getAbsoluteAndInOsFormatPath.d.ts +4 -0
- package/bin/tools/getAbsoluteAndInOsFormatPath.js +15 -0
- package/bin/tools/getAbsoluteAndInOsFormatPath.js.map +1 -0
- package/bin/tools/pathJoin.js +1 -1
- package/bin/tools/pathJoin.js.map +1 -1
- package/login/kcContext/KcContext.js.map +1 -1
- package/login/kcContext/createGetKcContext.js +2 -6
- package/login/kcContext/createGetKcContext.js.map +1 -1
- package/login/kcContext/kcContextMocks.js +5 -4
- package/login/kcContext/kcContextMocks.js.map +1 -1
- package/package.json +92 -21
- package/src/account/kcContext/KcContext.ts +2 -1
- package/src/account/kcContext/createGetKcContext.ts +2 -7
- package/src/account/kcContext/kcContextMocks.ts +5 -3
- package/src/bin/constants.ts +9 -0
- package/src/bin/copy-keycloak-resources-to-public.ts +20 -19
- package/src/bin/download-builtin-keycloak-theme.ts +14 -6
- package/src/bin/eject-keycloak-page.ts +5 -9
- package/src/bin/getSrcDirPath.ts +4 -4
- package/src/bin/initialize-email-theme.ts +7 -7
- package/src/bin/keycloakify/BuildOptions.ts +78 -59
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +4 -7
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountPages.java +33 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountProvider.java +76 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountProviderFactory.java +25 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountSpi.java +50 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/FreeMarkerAccountProvider.java +424 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/FreeMarkerAccountProviderFactory.java +51 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/Templates.java +51 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AccountBean.java +91 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AccountFederatedIdentityBean.java +157 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/ApplicationsBean.java +258 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AuthorizationBean.java +515 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/FeaturesBean.java +56 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/LogBean.java +95 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/PasswordBean.java +34 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/RealmBean.java +75 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/ReferrerBean.java +38 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/SessionsBean.java +93 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/TotpBean.java +125 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/UrlBean.java +121 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/AccountUrls.java +115 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/resources/account/AccountFormService.java +1320 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/resources/account/AccountFormServiceFactory.java +64 -0
- package/src/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.ts +92 -0
- package/src/bin/keycloakify/generateJavaStackFiles/generateJavaStackFiles.ts +211 -0
- package/src/bin/keycloakify/generateJavaStackFiles/index.ts +1 -0
- package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +21 -22
- package/src/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.ts +19 -15
- package/src/bin/keycloakify/generateTheme/generateMessageProperties.ts +1 -1
- package/src/bin/keycloakify/generateTheme/generateTheme.ts +78 -72
- package/src/bin/keycloakify/generateTheme/readExtraPageNames.ts +2 -1
- package/src/bin/keycloakify/generateTheme/readFieldNameUsage.ts +1 -1
- package/src/bin/keycloakify/generateTheme/readStaticResourcesUsage.ts +1 -1
- package/src/bin/keycloakify/keycloakify.ts +21 -44
- package/src/bin/keycloakify/parsedPackageJson.ts +11 -13
- package/src/bin/promptKeycloakVersion.ts +1 -1
- package/src/bin/tools/downloadAndUnzip.ts +6 -7
- package/src/bin/tools/getAbsoluteAndInOsFormatPath.ts +15 -0
- package/src/bin/tools/pathJoin.ts +1 -1
- package/src/login/kcContext/KcContext.ts +2 -1
- package/src/login/kcContext/createGetKcContext.ts +2 -7
- package/src/login/kcContext/kcContextMocks.ts +7 -5
- package/bin/keycloakify/generateJavaStackFiles.js +0 -103
- package/bin/keycloakify/generateJavaStackFiles.js.map +0 -1
- package/bin/mockTestingResourcesPath.d.ts +0 -3
- package/bin/mockTestingResourcesPath.js +0 -8
- package/bin/mockTestingResourcesPath.js.map +0 -1
- package/bin/tools/jar.d.ts +0 -33
- package/bin/tools/jar.js +0 -241
- package/bin/tools/jar.js.map +0 -1
- package/bin/tools/walk.d.ts +0 -8
- package/bin/tools/walk.js +0 -125
- package/bin/tools/walk.js.map +0 -1
- package/src/bin/keycloakify/generateJavaStackFiles.ts +0 -84
- package/src/bin/mockTestingResourcesPath.ts +0 -5
- package/src/bin/tools/jar.ts +0 -99
- package/src/bin/tools/walk.ts +0 -19
@@ -0,0 +1,64 @@
|
|
1
|
+
package org.keycloak.services.resources.account;
|
2
|
+
|
3
|
+
import com.google.auto.service.AutoService;
|
4
|
+
import com.google.common.collect.ImmutableMap;
|
5
|
+
import com.google.common.collect.ImmutableSet;
|
6
|
+
import java.util.Map;
|
7
|
+
import lombok.extern.jbosslog.JBossLog;
|
8
|
+
import org.keycloak.Config.Scope;
|
9
|
+
import org.keycloak.events.EventBuilder;
|
10
|
+
import org.keycloak.models.ClientModel;
|
11
|
+
import org.keycloak.models.KeycloakSession;
|
12
|
+
import org.keycloak.models.KeycloakSessionFactory;
|
13
|
+
import org.keycloak.models.ProtocolMapperModel;
|
14
|
+
import org.keycloak.models.RealmModel;
|
15
|
+
import org.keycloak.provider.ProviderEvent;
|
16
|
+
import org.keycloak.services.resource.AccountResourceProvider;
|
17
|
+
import org.keycloak.services.resource.AccountResourceProviderFactory;
|
18
|
+
import jakarta.ws.rs.NotFoundException;
|
19
|
+
import org.keycloak.models.Constants;
|
20
|
+
|
21
|
+
@JBossLog
|
22
|
+
@AutoService(AccountResourceProviderFactory.class)
|
23
|
+
public class AccountFormServiceFactory implements AccountResourceProviderFactory {
|
24
|
+
|
25
|
+
public static final String ID = "account-v1";
|
26
|
+
|
27
|
+
@Override
|
28
|
+
public String getId() {
|
29
|
+
return ID;
|
30
|
+
}
|
31
|
+
|
32
|
+
private ClientModel getAccountManagementClient(RealmModel realm) {
|
33
|
+
ClientModel client = realm.getClientByClientId(Constants.ACCOUNT_MANAGEMENT_CLIENT_ID);
|
34
|
+
if (client == null || !client.isEnabled()) {
|
35
|
+
log.debug("account management not enabled");
|
36
|
+
throw new NotFoundException("account management not enabled");
|
37
|
+
}
|
38
|
+
return client;
|
39
|
+
}
|
40
|
+
|
41
|
+
@Override
|
42
|
+
public AccountResourceProvider create(KeycloakSession session) {
|
43
|
+
log.info("create");
|
44
|
+
RealmModel realm = session.getContext().getRealm();
|
45
|
+
ClientModel client = getAccountManagementClient(realm);
|
46
|
+
EventBuilder event = new EventBuilder(realm, session, session.getContext().getConnection());
|
47
|
+
return new AccountFormService(session, client, event);
|
48
|
+
}
|
49
|
+
|
50
|
+
@Override
|
51
|
+
public void init(Scope config) {
|
52
|
+
log.info("init");
|
53
|
+
}
|
54
|
+
|
55
|
+
@Override
|
56
|
+
public void postInit(KeycloakSessionFactory factory) {
|
57
|
+
log.info("postInit");
|
58
|
+
}
|
59
|
+
|
60
|
+
@Override
|
61
|
+
public void close() {
|
62
|
+
log.info("close");
|
63
|
+
}
|
64
|
+
}
|
@@ -0,0 +1,194 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
|
+
});
|
33
|
+
};
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
38
|
+
function step(op) {
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
43
|
+
switch (op[0]) {
|
44
|
+
case 0: case 1: t = op; break;
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
48
|
+
default:
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
53
|
+
if (t[2]) _.ops.pop();
|
54
|
+
_.trys.pop(); continue;
|
55
|
+
}
|
56
|
+
op = body.call(thisArg, _);
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
59
|
+
}
|
60
|
+
};
|
61
|
+
var __read = (this && this.__read) || function (o, n) {
|
62
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
63
|
+
if (!m) return o;
|
64
|
+
var i = m.call(o), r, ar = [], e;
|
65
|
+
try {
|
66
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
67
|
+
}
|
68
|
+
catch (error) { e = { error: error }; }
|
69
|
+
finally {
|
70
|
+
try {
|
71
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
72
|
+
}
|
73
|
+
finally { if (e) throw e.error; }
|
74
|
+
}
|
75
|
+
return ar;
|
76
|
+
};
|
77
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
78
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
79
|
+
if (ar || !(i in from)) {
|
80
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
81
|
+
ar[i] = from[i];
|
82
|
+
}
|
83
|
+
}
|
84
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
85
|
+
};
|
86
|
+
var __values = (this && this.__values) || function(o) {
|
87
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
88
|
+
if (m) return m.call(o);
|
89
|
+
if (o && typeof o.length === "number") return {
|
90
|
+
next: function () {
|
91
|
+
if (o && i >= o.length) o = void 0;
|
92
|
+
return { value: o && o[i++], done: !o };
|
93
|
+
}
|
94
|
+
};
|
95
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
96
|
+
};
|
97
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
98
|
+
exports.bringInAccountV1 = void 0;
|
99
|
+
var fs = __importStar(require("fs"));
|
100
|
+
var path_1 = require("path");
|
101
|
+
var assert_1 = require("tsafe/assert");
|
102
|
+
var Reflect_1 = require("tsafe/Reflect");
|
103
|
+
var constants_1 = require("../../constants");
|
104
|
+
var download_builtin_keycloak_theme_1 = require("../../download-builtin-keycloak-theme");
|
105
|
+
var transformCodebase_1 = require("../../tools/transformCodebase");
|
106
|
+
{
|
107
|
+
var buildOptions = (0, Reflect_1.Reflect)();
|
108
|
+
(0, assert_1.assert)();
|
109
|
+
}
|
110
|
+
function bringInAccountV1(params) {
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
112
|
+
var buildOptions, builtinKeycloakThemeTmpDirPath, accountV1DirPath, commonResourceFilePaths, _a, _b, relativeFilePath, destFilePath, resourceFilePaths, _c, _d, relativeFilePath, destFilePath;
|
113
|
+
var e_1, _e, e_2, _f;
|
114
|
+
return __generator(this, function (_g) {
|
115
|
+
switch (_g.label) {
|
116
|
+
case 0:
|
117
|
+
buildOptions = params.buildOptions;
|
118
|
+
builtinKeycloakThemeTmpDirPath = (0, path_1.join)(buildOptions.keycloakifyBuildDirPath, "..", "tmp_yxdE2_builtin_keycloak_theme");
|
119
|
+
return [4 /*yield*/, (0, download_builtin_keycloak_theme_1.downloadBuiltinKeycloakTheme)({
|
120
|
+
"destDirPath": builtinKeycloakThemeTmpDirPath,
|
121
|
+
"keycloakVersion": constants_1.lastKeycloakVersionWithAccountV1,
|
122
|
+
buildOptions: buildOptions
|
123
|
+
})];
|
124
|
+
case 1:
|
125
|
+
_g.sent();
|
126
|
+
accountV1DirPath = (0, path_1.join)(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme", constants_1.accountV1, "account");
|
127
|
+
(0, transformCodebase_1.transformCodebase)({
|
128
|
+
"srcDirPath": (0, path_1.join)(builtinKeycloakThemeTmpDirPath, "base", "account"),
|
129
|
+
"destDirPath": accountV1DirPath
|
130
|
+
});
|
131
|
+
commonResourceFilePaths = [
|
132
|
+
"node_modules/patternfly/dist/css/patternfly.min.css",
|
133
|
+
"node_modules/patternfly/dist/css/patternfly-additions.min.css"
|
134
|
+
];
|
135
|
+
try {
|
136
|
+
for (_a = __values(commonResourceFilePaths.map(function (path) { return path_1.join.apply(void 0, __spreadArray([], __read(path.split("/")), false)); })), _b = _a.next(); !_b.done; _b = _a.next()) {
|
137
|
+
relativeFilePath = _b.value;
|
138
|
+
destFilePath = (0, path_1.join)(accountV1DirPath, "resources", constants_1.resources_common, relativeFilePath);
|
139
|
+
fs.mkdirSync((0, path_1.dirname)(destFilePath), { "recursive": true });
|
140
|
+
fs.cpSync((0, path_1.join)(builtinKeycloakThemeTmpDirPath, "keycloak", "common", "resources", relativeFilePath), destFilePath);
|
141
|
+
}
|
142
|
+
}
|
143
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
144
|
+
finally {
|
145
|
+
try {
|
146
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
147
|
+
}
|
148
|
+
finally { if (e_1) throw e_1.error; }
|
149
|
+
}
|
150
|
+
resourceFilePaths = ["css/account.css"];
|
151
|
+
try {
|
152
|
+
for (_c = __values(resourceFilePaths.map(function (path) { return path_1.join.apply(void 0, __spreadArray([], __read(path.split("/")), false)); })), _d = _c.next(); !_d.done; _d = _c.next()) {
|
153
|
+
relativeFilePath = _d.value;
|
154
|
+
destFilePath = (0, path_1.join)(accountV1DirPath, "resources", relativeFilePath);
|
155
|
+
fs.mkdirSync((0, path_1.dirname)(destFilePath), { "recursive": true });
|
156
|
+
fs.cpSync((0, path_1.join)(builtinKeycloakThemeTmpDirPath, "keycloak", "account", "resources", relativeFilePath), destFilePath);
|
157
|
+
}
|
158
|
+
}
|
159
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
160
|
+
finally {
|
161
|
+
try {
|
162
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
163
|
+
}
|
164
|
+
finally { if (e_2) throw e_2.error; }
|
165
|
+
}
|
166
|
+
fs.rmSync(builtinKeycloakThemeTmpDirPath, { "recursive": true });
|
167
|
+
fs.writeFileSync((0, path_1.join)(accountV1DirPath, "theme.properties"), Buffer.from([
|
168
|
+
"accountResourceProvider=org.keycloak.services.resources.account.AccountFormService",
|
169
|
+
"",
|
170
|
+
"locales=ar,ca,cs,da,de,en,es,fr,fi,hu,it,ja,lt,nl,no,pl,pt-BR,ru,sk,sv,tr,zh-CN",
|
171
|
+
"",
|
172
|
+
"styles=" + __spreadArray(__spreadArray([], __read(resourceFilePaths), false), __read(commonResourceFilePaths.map(function (path) { return "resources_common/".concat(path); })), false).join(" "),
|
173
|
+
"",
|
174
|
+
"##### css classes for form buttons",
|
175
|
+
"# main class used for all buttons",
|
176
|
+
"kcButtonClass=btn",
|
177
|
+
"# classes defining priority of the button - primary or default (there is typically only one priority button for the form)",
|
178
|
+
"kcButtonPrimaryClass=btn-primary",
|
179
|
+
"kcButtonDefaultClass=btn-default",
|
180
|
+
"# classes defining size of the button",
|
181
|
+
"kcButtonLargeClass=btn-lg",
|
182
|
+
""
|
183
|
+
].join("\n"), "utf8"));
|
184
|
+
(0, transformCodebase_1.transformCodebase)({
|
185
|
+
"srcDirPath": (0, path_1.join)(__dirname, "account-v1-java"),
|
186
|
+
"destDirPath": (0, path_1.join)(buildOptions.keycloakifyBuildDirPath, "src", "main", "java", "org", "keycloak")
|
187
|
+
});
|
188
|
+
return [2 /*return*/];
|
189
|
+
}
|
190
|
+
});
|
191
|
+
});
|
192
|
+
}
|
193
|
+
exports.bringInAccountV1 = bringInAccountV1;
|
194
|
+
//# sourceMappingURL=bringInAccountV1.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"bringInAccountV1.js","sourceRoot":"","sources":["../../../src/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AACzB,6BAAgE;AAChE,uCAAsC;AACtC,yCAAwC;AAExC,6CAAgG;AAChG,yFAAqF;AACrF,mEAAkE;AAOlE;IACI,IAAM,Y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AC3B,EAAE;qBACL,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ,MAAM,CACT,CACJ,CAAC;oBAEF,IAAA,qCAAiB,EAAC;wBACd,YAAY,EAAE,IAAA,WAAQ,EAAC,SAAS,EAAE,iBAAiB,CAAC;wBACpD,aAAa,EAAE,IAAA,WAAQ,EAAC,YAAY,CAAC,uBAAuB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC;qBAC1G,CAAC,CAAC;;;;;CACN;AAvED,4CAuEC"}
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import type
|
1
|
+
import { type ThemeType } from "../../constants";
|
2
2
|
export type BuildOptionsLike = {
|
3
|
-
themeName: string;
|
4
|
-
extraThemeNames: string[];
|
5
3
|
groupId: string;
|
6
4
|
artifactId: string;
|
7
5
|
themeVersion: string;
|
6
|
+
cacheDirPath: string;
|
7
|
+
keycloakifyBuildDirPath: string;
|
8
|
+
themeNames: string[];
|
8
9
|
};
|
9
10
|
export declare function generateJavaStackFiles(params: {
|
10
|
-
keycloakThemeBuildingDirPath: string;
|
11
11
|
implementedThemeTypes: Record<ThemeType | "email", boolean>;
|
12
12
|
buildOptions: BuildOptionsLike;
|
13
|
-
}): {
|
13
|
+
}): Promise<{
|
14
14
|
jarFilePath: string;
|
15
|
-
}
|
15
|
+
}>;
|
@@ -0,0 +1,276 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
|
+
});
|
33
|
+
};
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
38
|
+
function step(op) {
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
43
|
+
switch (op[0]) {
|
44
|
+
case 0: case 1: t = op; break;
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
48
|
+
default:
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
53
|
+
if (t[2]) _.ops.pop();
|
54
|
+
_.trys.pop(); continue;
|
55
|
+
}
|
56
|
+
op = body.call(thisArg, _);
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
59
|
+
}
|
60
|
+
};
|
61
|
+
var __read = (this && this.__read) || function (o, n) {
|
62
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
63
|
+
if (!m) return o;
|
64
|
+
var i = m.call(o), r, ar = [], e;
|
65
|
+
try {
|
66
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
67
|
+
}
|
68
|
+
catch (error) { e = { error: error }; }
|
69
|
+
finally {
|
70
|
+
try {
|
71
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
72
|
+
}
|
73
|
+
finally { if (e) throw e.error; }
|
74
|
+
}
|
75
|
+
return ar;
|
76
|
+
};
|
77
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
78
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
79
|
+
if (ar || !(i in from)) {
|
80
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
81
|
+
ar[i] = from[i];
|
82
|
+
}
|
83
|
+
}
|
84
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
85
|
+
};
|
86
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
87
|
+
exports.generateJavaStackFiles = void 0;
|
88
|
+
var fs = __importStar(require("fs"));
|
89
|
+
var path_1 = require("path");
|
90
|
+
var assert_1 = require("tsafe/assert");
|
91
|
+
var Reflect_1 = require("tsafe/Reflect");
|
92
|
+
var constants_1 = require("../../constants");
|
93
|
+
var bringInAccountV1_1 = require("./bringInAccountV1");
|
94
|
+
{
|
95
|
+
var buildOptions = (0, Reflect_1.Reflect)();
|
96
|
+
(0, assert_1.assert)();
|
97
|
+
}
|
98
|
+
function generateJavaStackFiles(params) {
|
99
|
+
return __awaiter(this, void 0, void 0, function () {
|
100
|
+
var implementedThemeTypes, buildOptions, pomFileCode, themeManifestFilePath;
|
101
|
+
return __generator(this, function (_a) {
|
102
|
+
switch (_a.label) {
|
103
|
+
case 0:
|
104
|
+
implementedThemeTypes = params.implementedThemeTypes, buildOptions = params.buildOptions;
|
105
|
+
{
|
106
|
+
pomFileCode = (function generatePomFileCode() {
|
107
|
+
var pomFileCode = [
|
108
|
+
"<?xml version=\"1.0\"?>",
|
109
|
+
"<project xmlns=\"http://maven.apache.org/POM/4.0.0\"",
|
110
|
+
"\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
|
111
|
+
"\txsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">",
|
112
|
+
"\t<modelVersion>4.0.0</modelVersion>",
|
113
|
+
"\t<groupId>".concat(buildOptions.groupId, "</groupId>"),
|
114
|
+
"\t<artifactId>".concat(buildOptions.artifactId, "</artifactId>"),
|
115
|
+
"\t<version>".concat(buildOptions.themeVersion, "</version>"),
|
116
|
+
"\t<name>".concat(buildOptions.artifactId, "</name>"),
|
117
|
+
"\t<description />",
|
118
|
+
"\t<packaging>jar</packaging>",
|
119
|
+
"\t<properties>",
|
120
|
+
"\t <java.version>17</java.version>",
|
121
|
+
"\t <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>",
|
122
|
+
"\t <keycloak.version>999.0.0-SNAPSHOT</keycloak.version>",
|
123
|
+
"\t <guava.version>32.0.0-jre</guava.version>",
|
124
|
+
"\t <lombok.version>1.18.28</lombok.version>",
|
125
|
+
"\t <auto-service.version>1.1.1</auto-service.version>",
|
126
|
+
"\t</properties>",
|
127
|
+
"\t<build>",
|
128
|
+
"\t <plugins>",
|
129
|
+
"\t <plugin>",
|
130
|
+
"\t <artifactId>maven-compiler-plugin</artifactId>",
|
131
|
+
"\t <version>3.11.0</version>",
|
132
|
+
"\t <configuration>",
|
133
|
+
"\t <source>${java.version}</source>",
|
134
|
+
"\t <target>${java.version}</target>",
|
135
|
+
"\t <compilerArgument>-Xlint:unchecked</compilerArgument>",
|
136
|
+
"\t <compilerArgument>-Xlint:deprecation</compilerArgument>",
|
137
|
+
"\t <useIncrementalCompilation>false</useIncrementalCompilation>",
|
138
|
+
"\t <annotationProcessorPaths>",
|
139
|
+
"\t <path>",
|
140
|
+
"\t <groupId>com.google.auto.service</groupId>",
|
141
|
+
"\t <artifactId>auto-service</artifactId>",
|
142
|
+
"\t <version>${auto-service.version}</version>",
|
143
|
+
"\t </path>",
|
144
|
+
"\t <path>",
|
145
|
+
"\t <groupId>org.projectlombok</groupId>",
|
146
|
+
"\t <artifactId>lombok</artifactId>",
|
147
|
+
"\t <version>${lombok.version}</version>",
|
148
|
+
"\t </path>",
|
149
|
+
"\t </annotationProcessorPaths>",
|
150
|
+
"\t </configuration>",
|
151
|
+
"\t </plugin>",
|
152
|
+
"\t <plugin>",
|
153
|
+
"\t <groupId>org.apache.maven.plugins</groupId>",
|
154
|
+
"\t <artifactId>maven-jar-plugin</artifactId>",
|
155
|
+
"\t <version>3.2.0</version>",
|
156
|
+
"\t <configuration>",
|
157
|
+
"\t <archive>",
|
158
|
+
"\t <manifestEntries>",
|
159
|
+
"\t <Dependencies>",
|
160
|
+
"\t <![CDATA[org.keycloak.keycloak-common,org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.keycloak.keycloak-services,com.google.guava]]>",
|
161
|
+
"\t </Dependencies>",
|
162
|
+
"\t </manifestEntries>",
|
163
|
+
"\t </archive>",
|
164
|
+
"\t </configuration>",
|
165
|
+
"\t </plugin>",
|
166
|
+
"\t <plugin>",
|
167
|
+
"\t <groupId>com.spotify.fmt</groupId>",
|
168
|
+
"\t <artifactId>fmt-maven-plugin</artifactId>",
|
169
|
+
"\t <version>2.20</version>",
|
170
|
+
"\t </plugin>",
|
171
|
+
"\t </plugins>",
|
172
|
+
"\t</build>",
|
173
|
+
"\t<dependencies>",
|
174
|
+
"\t <dependency>",
|
175
|
+
"\t <groupId>org.projectlombok</groupId>",
|
176
|
+
"\t <artifactId>lombok</artifactId>",
|
177
|
+
"\t <version>${lombok.version}</version>",
|
178
|
+
"\t <scope>provided</scope>",
|
179
|
+
"\t </dependency>",
|
180
|
+
"\t <dependency>",
|
181
|
+
"\t <groupId>com.google.auto.service</groupId>",
|
182
|
+
"\t <artifactId>auto-service</artifactId>",
|
183
|
+
"\t <version>${auto-service.version}</version>",
|
184
|
+
"\t <scope>provided</scope>",
|
185
|
+
"\t </dependency>",
|
186
|
+
"\t <dependency>",
|
187
|
+
"\t <groupId>org.keycloak</groupId>",
|
188
|
+
"\t <artifactId>keycloak-server-spi</artifactId>",
|
189
|
+
"\t <version>${keycloak.version}</version>",
|
190
|
+
"\t <scope>provided</scope>",
|
191
|
+
"\t </dependency>",
|
192
|
+
"\t <dependency>",
|
193
|
+
"\t <groupId>org.keycloak</groupId>",
|
194
|
+
"\t <artifactId>keycloak-server-spi-private</artifactId>",
|
195
|
+
"\t <version>${keycloak.version}</version>",
|
196
|
+
"\t <scope>provided</scope>",
|
197
|
+
"\t </dependency>",
|
198
|
+
"\t <dependency>",
|
199
|
+
"\t <groupId>org.keycloak</groupId>",
|
200
|
+
"\t <artifactId>keycloak-services</artifactId>",
|
201
|
+
"\t <version>${keycloak.version}</version>",
|
202
|
+
"\t <scope>provided</scope>",
|
203
|
+
"\t </dependency>",
|
204
|
+
"\t <dependency>",
|
205
|
+
"\t <groupId>jakarta.ws.rs</groupId>",
|
206
|
+
"\t <artifactId>jakarta.ws.rs-api</artifactId>",
|
207
|
+
"\t <version>3.1.0</version>",
|
208
|
+
"\t <scope>provided</scope>",
|
209
|
+
"\t </dependency>",
|
210
|
+
"\t <dependency>",
|
211
|
+
"\t <groupId>com.google.guava</groupId>",
|
212
|
+
"\t <artifactId>guava</artifactId>",
|
213
|
+
"\t <version>${guava.version}</version>",
|
214
|
+
"\t <scope>provided</scope>",
|
215
|
+
"\t </dependency>",
|
216
|
+
"\t</dependencies>",
|
217
|
+
"</project>"
|
218
|
+
].join("\n");
|
219
|
+
return { pomFileCode: pomFileCode };
|
220
|
+
})().pomFileCode;
|
221
|
+
fs.writeFileSync((0, path_1.join)(buildOptions.keycloakifyBuildDirPath, "pom.xml"), Buffer.from(pomFileCode, "utf8"));
|
222
|
+
}
|
223
|
+
if (!implementedThemeTypes.account) return [3 /*break*/, 2];
|
224
|
+
return [4 /*yield*/, (0, bringInAccountV1_1.bringInAccountV1)({ buildOptions: buildOptions })];
|
225
|
+
case 1:
|
226
|
+
_a.sent();
|
227
|
+
_a.label = 2;
|
228
|
+
case 2:
|
229
|
+
{
|
230
|
+
themeManifestFilePath = (0, path_1.join)(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "META-INF", "keycloak-themes.json");
|
231
|
+
try {
|
232
|
+
fs.mkdirSync((0, path_1.dirname)(themeManifestFilePath));
|
233
|
+
}
|
234
|
+
catch (_b) { }
|
235
|
+
fs.writeFileSync(themeManifestFilePath, Buffer.from(JSON.stringify({
|
236
|
+
"themes": __spreadArray(__spreadArray([], __read((!implementedThemeTypes.account
|
237
|
+
? []
|
238
|
+
: [
|
239
|
+
{
|
240
|
+
"name": constants_1.accountV1,
|
241
|
+
"types": ["account"]
|
242
|
+
}
|
243
|
+
])), false), __read(buildOptions.themeNames
|
244
|
+
.map(function (themeName) { return __spreadArray([
|
245
|
+
{
|
246
|
+
"name": themeName,
|
247
|
+
"types": Object.entries(implementedThemeTypes)
|
248
|
+
.filter(function (_a) {
|
249
|
+
var _b = __read(_a, 2), isImplemented = _b[1];
|
250
|
+
return isImplemented;
|
251
|
+
})
|
252
|
+
.map(function (_a) {
|
253
|
+
var _b = __read(_a, 1), themeType = _b[0];
|
254
|
+
return themeType;
|
255
|
+
})
|
256
|
+
}
|
257
|
+
], __read((!implementedThemeTypes.account
|
258
|
+
? []
|
259
|
+
: [
|
260
|
+
{
|
261
|
+
"name": "".concat(themeName).concat(constants_1.retrocompatPostfix),
|
262
|
+
"types": ["account"]
|
263
|
+
}
|
264
|
+
])), false); })
|
265
|
+
.flat()), false)
|
266
|
+
}, null, 2), "utf8"));
|
267
|
+
}
|
268
|
+
return [2 /*return*/, {
|
269
|
+
"jarFilePath": (0, path_1.join)(buildOptions.keycloakifyBuildDirPath, "target", "".concat(buildOptions.artifactId, "-").concat(buildOptions.themeVersion, ".jar"))
|
270
|
+
}];
|
271
|
+
}
|
272
|
+
});
|
273
|
+
});
|
274
|
+
}
|
275
|
+
exports.generateJavaStackFiles = generateJavaStackFiles;
|
276
|
+
//# sourceMappingURL=generateJavaStackFiles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generateJavaStackFiles.js","sourceRoot":"","sources":["../../../src/bin/keycloakify/generateJavaStackFiles/generateJavaStackFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AACzB,6BAAgE;AAChE,uCAAsC;AACtC,yCAAwC;AA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,CAejB,CAAC;iCACD,IAAI,EAAE,SACd;yBACJ,EACD,IAAI,EACJ,CAAC,CACJ,EACD,MAAM,CACT,CACJ,CAAC;qBACL;oBAED,sBAAO;4BACH,aAAa,EAAE,IAAA,WAAQ,EAAC,YAAY,CAAC,uBAAuB,EAAE,QAAQ,EAAE,UAAG,YAAY,CAAC,UAAU,cAAI,YAAY,CAAC,YAAY,SAAM,CAAC;yBACzI,EAAC;;;;CACL;AA3LD,wDA2LC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./generateJavaStackFiles";
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./generateJavaStackFiles"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bin/keycloakify/generateJavaStackFiles/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
|
@@ -1,11 +1,9 @@
|
|
1
1
|
export type BuildOptionsLike = {
|
2
|
-
|
3
|
-
extraThemeNames: string[];
|
2
|
+
keycloakifyBuildDirPath: string;
|
4
3
|
};
|
5
4
|
/** Files for being able to run a hot reload keycloak container */
|
6
5
|
export declare function generateStartKeycloakTestingContainer(params: {
|
7
6
|
keycloakVersion: string;
|
8
|
-
keycloakThemeBuildingDirPath: string;
|
9
7
|
buildOptions: BuildOptionsLike;
|
10
8
|
}): void;
|
11
9
|
export declare namespace generateStartKeycloakTestingContainer {
|