keycloakify 11.3.7-rc.0 → 11.3.7

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 CHANGED
@@ -69,7 +69,7 @@ Project backers, we trust and recommend their services.
69
69
  <br/>
70
70
 
71
71
  <p align="center">
72
- <i><a href="https://phasetwo.io/"><strong>Keycloak on Steroids as a Service</strong></a> - Keycloak community contributors of popular <a href="https://github.com/p2-inc#our-extensions-">extensions</a> providing free and dedicated <a href="https://phasetwo.io/hosting/">Keycloak hosting</a> and enterprise <a href="https://phasetwo.io/support/">Keycloak support</a> to businesses of all sizes.</i>
72
+ <i><a href="https://phasetwo.io/?utm_source=keycloakify"><strong>Keycloak as a Service</strong></a> - Keycloak community contributors of popular <a href="https://github.com/p2-inc#our-extensions-?utm_source=keycloakify">extensions</a> providing free and dedicated <a href="https://phasetwo.io/hosting/?utm_source=keycloakify">Keycloak hosting</a> and enterprise <a href="https://phasetwo.io/support/?utm_source=keycloakify">Keycloak support</a> to businesses of all sizes.</i>
73
73
  </p>
74
74
 
75
75
  <br/>
package/bin/526.index.js CHANGED
@@ -442,10 +442,10 @@ async function command(params) {
442
442
  ...(realmJsonFilePath === undefined
443
443
  ? []
444
444
  : [
445
- `-v${SPACE_PLACEHOLDER}"${realmJsonFilePath}":/opt/keycloak/data/import/myrealm-realm.json`
445
+ `-v${SPACE_PLACEHOLDER}".${external_path_.sep}${(0,external_path_.relative)(process.cwd(), realmJsonFilePath)}":/opt/keycloak/data/import/myrealm-realm.json`
446
446
  ]),
447
- `-v${SPACE_PLACEHOLDER}"${jarFilePath_cacheDir}":/opt/keycloak/providers/keycloak-theme.jar`,
448
- ...extensionJarFilePaths.map(jarFilePath => `-v${SPACE_PLACEHOLDER}"${jarFilePath}":/opt/keycloak/providers/${(0,external_path_.basename)(jarFilePath)}`),
447
+ `-v${SPACE_PLACEHOLDER}".${external_path_.sep}${(0,external_path_.relative)(process.cwd(), jarFilePath_cacheDir)}":/opt/keycloak/providers/keycloak-theme.jar`,
448
+ ...extensionJarFilePaths.map(jarFilePath => `-v${SPACE_PLACEHOLDER}".${external_path_.sep}${(0,external_path_.relative)(process.cwd(), jarFilePath)}":/opt/keycloak/providers/${(0,external_path_.basename)(jarFilePath)}`),
449
449
  ...(keycloakMajorVersionNumber <= 20
450
450
  ? [`-e${SPACE_PLACEHOLDER}JAVA_OPTS=-Dkeycloak.profile=preview`]
451
451
  : []),
@@ -459,7 +459,7 @@ async function command(params) {
459
459
  localDirPath: (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "theme", themeName),
460
460
  containerDirPath: `/opt/keycloak/themes/${themeName}`
461
461
  }))
462
- .map(({ localDirPath, containerDirPath }) => `-v${SPACE_PLACEHOLDER}"${localDirPath}":${containerDirPath}:rw`),
462
+ .map(({ localDirPath, containerDirPath }) => `-v${SPACE_PLACEHOLDER}".${external_path_.sep}${(0,external_path_.relative)(process.cwd(), localDirPath)}":${containerDirPath}:rw`),
463
463
  ...buildContext.environmentVariables
464
464
  .map(({ name }) => ({ name, envValue: process.env[name] }))
465
465
  .map(({ name, envValue }) => envValue === undefined ? undefined : { name, envValue })
@@ -477,8 +477,6 @@ async function command(params) {
477
477
  buildContext.startKeycloakOptions.keycloakExtraArgs.join(SPACE_PLACEHOLDER)
478
478
  ])
479
479
  ];
480
- console.log("DEBUG issue #694");
481
- console.log(JSON.stringify(dockerRunArgs, null, 2));
482
480
  console.log(source_default().blue([
483
481
  `$ docker run \\`,
484
482
  ...dockerRunArgs
package/bin/932.index.js CHANGED
@@ -18,6 +18,13 @@ __webpack_require__.r(__webpack_exports__);
18
18
  /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_3__);
19
19
  /* harmony import */ var _tools_downloadAndExtractArchive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38367);
20
20
  /* harmony import */ var _shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(72138);
21
+ /* harmony import */ var make_fetch_happen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9525);
22
+ /* harmony import */ var make_fetch_happen__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(make_fetch_happen__WEBPACK_IMPORTED_MODULE_6__);
23
+ /* harmony import */ var _tools_SemVer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12171);
24
+ /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(29041);
25
+
26
+
27
+
21
28
 
22
29
 
23
30
 
@@ -40,15 +47,31 @@ async function command(params) {
40
47
  process.exit(-1);
41
48
  }
42
49
  console.log("Initialize with the base email theme from which version of Keycloak?");
43
- const { keycloakVersion } = await (0,_shared_promptKeycloakVersion__WEBPACK_IMPORTED_MODULE_2__/* .promptKeycloakVersion */ .s)({
50
+ let { keycloakVersion } = await (0,_shared_promptKeycloakVersion__WEBPACK_IMPORTED_MODULE_2__/* .promptKeycloakVersion */ .s)({
44
51
  // NOTE: This is arbitrary
45
52
  startingFromMajor: 17,
46
53
  excludeMajorVersions: [],
47
54
  doOmitPatch: false,
48
55
  buildContext
49
56
  });
57
+ const getUrl = (keycloakVersion) => {
58
+ return `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`;
59
+ };
60
+ keycloakVersion = await (async () => {
61
+ const keycloakVersionParsed = _tools_SemVer__WEBPACK_IMPORTED_MODULE_7__/* .SemVer.parse */ .h.parse(keycloakVersion);
62
+ while (true) {
63
+ const url = getUrl(_tools_SemVer__WEBPACK_IMPORTED_MODULE_7__/* .SemVer.stringify */ .h.stringify(keycloakVersionParsed));
64
+ const response = await make_fetch_happen__WEBPACK_IMPORTED_MODULE_6___default()(url, buildContext.fetchOptions);
65
+ if (response.ok) {
66
+ break;
67
+ }
68
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .h)(keycloakVersionParsed.patch !== 0);
69
+ keycloakVersionParsed.patch--;
70
+ }
71
+ return _tools_SemVer__WEBPACK_IMPORTED_MODULE_7__/* .SemVer.stringify */ .h.stringify(keycloakVersionParsed);
72
+ })();
50
73
  const { extractedDirPath } = await (0,_tools_downloadAndExtractArchive__WEBPACK_IMPORTED_MODULE_4__/* .downloadAndExtractArchive */ .I)({
51
- url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
74
+ url: getUrl(keycloakVersion),
52
75
  cacheDirPath: buildContext.cacheDirPath,
53
76
  fetchOptions: buildContext.fetchOptions,
54
77
  uniqueIdOfOnArchiveFile: "extractOnlyEmailTheme",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.3.7-rc.0",
3
+ "version": "11.3.7",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -5,6 +5,9 @@ import type { BuildContext } from "./shared/buildContext";
5
5
  import * as fs from "fs";
6
6
  import { downloadAndExtractArchive } from "./tools/downloadAndExtractArchive";
7
7
  import { maybeDelegateCommandToCustomHandler } from "./shared/customHandler_delegate";
8
+ import fetch from "make-fetch-happen";
9
+ import { SemVer } from "./tools/SemVer";
10
+ import { assert } from "tsafe/assert";
8
11
 
9
12
  export async function command(params: { buildContext: BuildContext }) {
10
13
  const { buildContext } = params;
@@ -36,7 +39,7 @@ export async function command(params: { buildContext: BuildContext }) {
36
39
 
37
40
  console.log("Initialize with the base email theme from which version of Keycloak?");
38
41
 
39
- const { keycloakVersion } = await promptKeycloakVersion({
42
+ let { keycloakVersion } = await promptKeycloakVersion({
40
43
  // NOTE: This is arbitrary
41
44
  startingFromMajor: 17,
42
45
  excludeMajorVersions: [],
@@ -44,8 +47,32 @@ export async function command(params: { buildContext: BuildContext }) {
44
47
  buildContext
45
48
  });
46
49
 
50
+ const getUrl = (keycloakVersion: string) => {
51
+ return `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`;
52
+ };
53
+
54
+ keycloakVersion = await (async () => {
55
+ const keycloakVersionParsed = SemVer.parse(keycloakVersion);
56
+
57
+ while (true) {
58
+ const url = getUrl(SemVer.stringify(keycloakVersionParsed));
59
+
60
+ const response = await fetch(url, buildContext.fetchOptions);
61
+
62
+ if (response.ok) {
63
+ break;
64
+ }
65
+
66
+ assert(keycloakVersionParsed.patch !== 0);
67
+
68
+ keycloakVersionParsed.patch--;
69
+ }
70
+
71
+ return SemVer.stringify(keycloakVersionParsed);
72
+ })();
73
+
47
74
  const { extractedDirPath } = await downloadAndExtractArchive({
48
- url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
75
+ url: getUrl(keycloakVersion),
49
76
  cacheDirPath: buildContext.cacheDirPath,
50
77
  fetchOptions: buildContext.fetchOptions,
51
78
  uniqueIdOfOnArchiveFile: "extractOnlyEmailTheme",
@@ -396,12 +396,12 @@ export async function command(params: {
396
396
  ...(realmJsonFilePath === undefined
397
397
  ? []
398
398
  : [
399
- `-v${SPACE_PLACEHOLDER}"${realmJsonFilePath}":/opt/keycloak/data/import/myrealm-realm.json`
399
+ `-v${SPACE_PLACEHOLDER}".${pathSep}${pathRelative(process.cwd(), realmJsonFilePath)}":/opt/keycloak/data/import/myrealm-realm.json`
400
400
  ]),
401
- `-v${SPACE_PLACEHOLDER}"${jarFilePath_cacheDir}":/opt/keycloak/providers/keycloak-theme.jar`,
401
+ `-v${SPACE_PLACEHOLDER}".${pathSep}${pathRelative(process.cwd(), jarFilePath_cacheDir)}":/opt/keycloak/providers/keycloak-theme.jar`,
402
402
  ...extensionJarFilePaths.map(
403
403
  jarFilePath =>
404
- `-v${SPACE_PLACEHOLDER}"${jarFilePath}":/opt/keycloak/providers/${pathBasename(jarFilePath)}`
404
+ `-v${SPACE_PLACEHOLDER}".${pathSep}${pathRelative(process.cwd(), jarFilePath)}":/opt/keycloak/providers/${pathBasename(jarFilePath)}`
405
405
  ),
406
406
  ...(keycloakMajorVersionNumber <= 20
407
407
  ? [`-e${SPACE_PLACEHOLDER}JAVA_OPTS=-Dkeycloak.profile=preview`]
@@ -424,7 +424,7 @@ export async function command(params: {
424
424
  }))
425
425
  .map(
426
426
  ({ localDirPath, containerDirPath }) =>
427
- `-v${SPACE_PLACEHOLDER}"${localDirPath}":${containerDirPath}:rw`
427
+ `-v${SPACE_PLACEHOLDER}".${pathSep}${pathRelative(process.cwd(), localDirPath)}":${containerDirPath}:rw`
428
428
  ),
429
429
  ...buildContext.environmentVariables
430
430
  .map(({ name }) => ({ name, envValue: process.env[name] }))
@@ -451,10 +451,6 @@ export async function command(params: {
451
451
  ])
452
452
  ];
453
453
 
454
- console.log("DEBUG issue #694");
455
-
456
- console.log(JSON.stringify(dockerRunArgs, null, 2));
457
-
458
454
  console.log(
459
455
  chalk.blue(
460
456
  [