keycloakify 11.15.4 → 11.15.6

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
@@ -147,6 +147,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
147
147
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/LennartMart"><img src="https://avatars.githubusercontent.com/u/1591933?v=4?s=100" width="100px;" alt="LennartMart"/><br /><sub><b>LennartMart</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=LennartMart" title="Code">💻</a></td>
148
148
  <td align="center" valign="top" width="14.28%"><a href="https://federicobartoli.it/"><img src="https://avatars.githubusercontent.com/u/27234034?v=4?s=100" width="100px;" alt="Federico Bartoli"/><br /><sub><b>Federico Bartoli</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=federicobartoli" title="Code">💻</a></td>
149
149
  <td align="center" valign="top" width="14.28%"><a href="https://www.oussemasahbeni.com"><img src="https://avatars.githubusercontent.com/u/104161749?v=4?s=100" width="100px;" alt="Oussema Sahbeni"/><br /><sub><b>Oussema Sahbeni</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=Oussemasahbeni" title="Code">💻</a></td>
150
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/githrdw"><img src="https://avatars.githubusercontent.com/u/1455140?v=4?s=100" width="100px;" alt="githrdw"/><br /><sub><b>githrdw</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=githrdw" title="Code">💻</a></td>
150
151
  </tr>
151
152
  </tbody>
152
153
  </table>
package/bin/375.index.js CHANGED
@@ -54,12 +54,16 @@ var yauzl = __webpack_require__(78781);
54
54
  // EXTERNAL MODULE: external "stream"
55
55
  var external_stream_ = __webpack_require__(12781);
56
56
  var external_stream_default = /*#__PURE__*/__webpack_require__.n(external_stream_);
57
- // EXTERNAL MODULE: ./node_modules/evt/tools/Deferred.js
58
- var Deferred = __webpack_require__(50689);
59
57
  // EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
60
58
  var fs_existsAsync = __webpack_require__(43765);
61
59
  ;// CONCATENATED MODULE: ./dist/bin/tools/extractArchive.js
62
-
60
+ var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
61
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
62
+ var m = o[Symbol.asyncIterator], i;
63
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
64
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
65
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
66
+ };
63
67
 
64
68
 
65
69
 
@@ -67,21 +71,9 @@ var fs_existsAsync = __webpack_require__(43765);
67
71
 
68
72
 
69
73
  async function extractArchive(params) {
74
+ var _a, e_1, _b, _c;
70
75
  const { archiveFilePath, onArchiveFile } = params;
71
- const zipFile = await new Promise((resolve, reject) => {
72
- yauzl.open(archiveFilePath, { lazyEntries: true }, async (error, zipFile) => {
73
- if (error) {
74
- reject(error);
75
- return;
76
- }
77
- resolve(zipFile);
78
- });
79
- });
80
- const dDone = new Deferred.Deferred();
81
- zipFile.once("end", () => {
82
- zipFile.close();
83
- dDone.resolve();
84
- });
76
+ const zipFile = await yauzl.openPromise(archiveFilePath);
85
77
  const writeFile = async (entry, params) => {
86
78
  const { filePath, modifiedData } = params;
87
79
  {
@@ -94,66 +86,72 @@ async function extractArchive(params) {
94
86
  await promises_default().writeFile(filePath, modifiedData);
95
87
  return;
96
88
  }
97
- const readStream = await new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
98
- if (error) {
99
- dDone.reject(error);
100
- return;
101
- }
102
- resolve(readStream);
103
- }));
104
- const dDoneWithFile = new Deferred.Deferred();
105
- external_stream_default().pipeline(readStream, external_fs_default().createWriteStream(filePath), error => {
106
- if (error) {
107
- dDone.reject(error);
108
- return;
109
- }
110
- dDoneWithFile.resolve();
89
+ const readStream = await zipFile.openReadStreamPromise(entry);
90
+ await new Promise((resolve, reject) => {
91
+ external_stream_default().pipeline(readStream, external_fs_default().createWriteStream(filePath), error => {
92
+ if (error) {
93
+ reject(error);
94
+ return;
95
+ }
96
+ resolve();
97
+ });
111
98
  });
112
- await dDoneWithFile.pr;
113
99
  };
114
- const readFile = (entry) => new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
115
- if (error) {
116
- dDone.reject(error);
117
- return;
118
- }
119
- const chunks = [];
120
- readStream.on("data", chunk => {
121
- chunks.push(chunk);
122
- });
123
- readStream.on("end", () => {
124
- resolve(Buffer.concat(chunks));
125
- });
126
- readStream.on("error", error => {
127
- dDone.reject(error);
100
+ const readFile = async (entry) => {
101
+ const readStream = await zipFile.openReadStreamPromise(entry);
102
+ return new Promise((resolve, reject) => {
103
+ const chunks = [];
104
+ readStream.on("data", chunk => {
105
+ chunks.push(chunk);
106
+ });
107
+ readStream.on("end", () => {
108
+ resolve(Buffer.concat(chunks));
109
+ });
110
+ readStream.on("error", reject);
128
111
  });
129
- }));
130
- zipFile.on("entry", async (entry) => {
131
- handle_file: {
132
- // NOTE: Skip directories
133
- if (entry.fileName.endsWith("/")) {
134
- break handle_file;
135
- }
136
- let hasEarlyExitBeenCalled = false;
137
- await onArchiveFile({
138
- relativeFilePathInArchive: entry.fileName.split("/").join(external_path_.sep),
139
- readFile: () => readFile(entry),
140
- writeFile: params => writeFile(entry, params),
141
- earlyExit: () => {
142
- hasEarlyExitBeenCalled = true;
112
+ };
113
+ try {
114
+ for (var _d = true, _e = __asyncValues(zipFile.eachEntry()), _f; _f = await _e.next(), _a = _f.done, !_a;) {
115
+ _c = _f.value;
116
+ _d = false;
117
+ try {
118
+ const entry = _c;
119
+ handle_file: {
120
+ // NOTE: Skip directories
121
+ if (entry.fileName.endsWith("/")) {
122
+ break handle_file;
123
+ }
124
+ let hasEarlyExitBeenCalled = false;
125
+ await onArchiveFile({
126
+ relativeFilePathInArchive: entry.fileName.split("/").join(external_path_.sep),
127
+ readFile: () => readFile(entry),
128
+ writeFile: params => writeFile(entry, params),
129
+ earlyExit: () => {
130
+ hasEarlyExitBeenCalled = true;
131
+ }
132
+ });
133
+ if (hasEarlyExitBeenCalled) {
134
+ zipFile.close();
135
+ return;
136
+ }
143
137
  }
144
- });
145
- if (hasEarlyExitBeenCalled) {
146
- zipFile.close();
147
- dDone.resolve();
148
- return;
138
+ }
139
+ finally {
140
+ _d = true;
149
141
  }
150
142
  }
151
- zipFile.readEntry();
152
- });
153
- zipFile.readEntry();
154
- await dDone.pr;
143
+ }
144
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
145
+ finally {
146
+ try {
147
+ if (!_d && !_a && (_b = _e.return)) await _b.call(_e);
148
+ }
149
+ finally { if (e_1) throw e_1.error; }
150
+ }
155
151
  }
156
152
  //# sourceMappingURL=extractArchive.js.map
153
+ // EXTERNAL MODULE: ./node_modules/evt/tools/Deferred.js
154
+ var Deferred = __webpack_require__(50689);
157
155
  // EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
158
156
  var id = __webpack_require__(38469);
159
157
  // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
@@ -249,7 +247,7 @@ async function appBuild(params) {
249
247
  }
250
248
  const dIsSuccess = new Deferred.Deferred();
251
249
  console.log(source_default().blue("$ npx vite build"));
252
- const child = external_child_process_.spawn("npx", ["vite", "build"], {
250
+ const child = external_child_process_.spawn("npx vite build", {
253
251
  cwd: buildContext.projectDirPath,
254
252
  shell: true
255
253
  });
@@ -311,7 +309,7 @@ async function keycloakifyBuild(params) {
311
309
  const { buildForKeycloakMajorVersionNumber, buildContext } = params;
312
310
  const dResult = new Deferred.Deferred();
313
311
  console.log(source_default().blue("$ npx keycloakify build"));
314
- const child = external_child_process_.spawn("npx", ["keycloakify", "build"], {
312
+ const child = external_child_process_.spawn("npx keycloakify build", {
315
313
  cwd: buildContext.projectDirPath,
316
314
  env: Object.assign(Object.assign({}, process.env), { [constants/* BUILD_FOR_KEYCLOAK_MAJOR_VERSION_ENV_NAME */.ac]: `${buildForKeycloakMajorVersionNumber}` }),
317
315
  shell: true
@@ -536,7 +534,7 @@ var SuccessTracker;
536
534
  function startViteDevServer(params) {
537
535
  const { buildContext } = params;
538
536
  console.log(source_default().blue(`$ npx vite dev`));
539
- const child = external_child_process_.spawn("npx", ["vite", "dev"], {
537
+ const child = external_child_process_.spawn("npx vite dev", {
540
538
  cwd: buildContext.projectDirPath,
541
539
  env: Object.assign(Object.assign({}, process.env), { [constants/* VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES.READ_KC_CONTEXT_FROM_URL */.TE.READ_KC_CONTEXT_FROM_URL]: "true" }),
542
540
  shell: true
@@ -1327,7 +1325,7 @@ async function dumpContainerConfig(params) {
1327
1325
  }
1328
1326
  {
1329
1327
  const dCompleted = new Deferred.Deferred();
1330
- const child = external_child_process_default().spawn("docker", [
1328
+ const dockerArguments = [
1331
1329
  ...["exec", constants/* CONTAINER_NAME */.sv],
1332
1330
  ...["/opt/keycloak/bin/kc.sh", "export"],
1333
1331
  ...["--dir", "/tmp"],
@@ -1342,7 +1340,8 @@ async function dumpContainerConfig(params) {
1342
1340
  '"jdbc:h2:file:/tmp/h2/keycloakdb;NON_KEYWORDS=VALUE"'
1343
1341
  ]
1344
1342
  ])
1345
- ], { shell: true });
1343
+ ];
1344
+ const child = external_child_process_default().spawn("docker " + dockerArguments.join(" "), { shell: true });
1346
1345
  let output = "";
1347
1346
  const onExit = (code) => {
1348
1347
  dCompleted.reject(new Error(`docker exec kc.sh export command failed with code ${code}`));
@@ -1909,7 +1908,8 @@ async function command(params) {
1909
1908
  .map(arg => arg.replace(new RegExp(SPACE_PLACEHOLDER, "g"), " "))
1910
1909
  .map((line, i, arr) => ` ${line}${arr.length - 1 === i ? "" : " \\"}`)
1911
1910
  ].join("\n")));
1912
- const child = external_child_process_.spawn("docker", ["run", ...dockerRunArgs.map(line => line.split(SPACE_PLACEHOLDER)).flat()], { shell: true });
1911
+ const child = external_child_process_.spawn("docker run " +
1912
+ dockerRunArgs.map(line => line.split(SPACE_PLACEHOLDER)).flat().join(" "), { shell: true });
1913
1913
  child.stdout.on("data", async (data) => {
1914
1914
  if (data.toString("utf8").includes("keycloakify-logging: REALM_CONFIG_CHANGED")) {
1915
1915
  await onRealmConfigChange();
package/bin/502.index.js CHANGED
@@ -301,7 +301,8 @@ async function npmInstall(params) {
301
301
  async function runPackageManagerInstall(params) {
302
302
  const { packageManagerBinName, cwd } = params;
303
303
  const dCompleted = new Deferred.Deferred();
304
- const child = external_child_process_.spawn(packageManagerBinName, ["install", ...(packageManagerBinName !== "npm" ? [] : ["--force"])], {
304
+ const packageManagerArguments = ["install", ...(packageManagerBinName !== "npm" ? [] : ["--force"])];
305
+ const child = external_child_process_.spawn(packageManagerBinName + " " + packageManagerArguments.join(" "), {
305
306
  cwd,
306
307
  env: process.env,
307
308
  shell: true