keycloakify 11.5.1 → 11.5.2
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/40.index.js +85 -0
- package/bin/490.index.js +85 -0
- package/bin/573.index.js +85 -0
- package/bin/653.index.js +85 -0
- package/bin/658.index.js +85 -0
- package/bin/682.index.js +119 -14
- package/bin/735.index.js +85 -0
- package/bin/main.js +1 -118
- package/bin/start-keycloak/getSupportedDockerImageTags.d.ts +4 -1
- package/package.json +1 -1
- package/src/bin/main.ts +2 -41
- package/src/bin/start-keycloak/getSupportedDockerImageTags.ts +51 -14
- package/src/bin/start-keycloak/start-keycloak.ts +3 -3
package/bin/40.index.js
CHANGED
@@ -155,6 +155,91 @@ function maybeDelegateCommandToCustomHandler(params) {
|
|
155
155
|
|
156
156
|
/***/ }),
|
157
157
|
|
158
|
+
/***/ 12171:
|
159
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
160
|
+
|
161
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
162
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
163
|
+
/* harmony export */ });
|
164
|
+
var SemVer;
|
165
|
+
(function (SemVer) {
|
166
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
167
|
+
function parse(versionStr) {
|
168
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
169
|
+
if (!match) {
|
170
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
171
|
+
}
|
172
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
173
|
+
const str = match[3];
|
174
|
+
return str === undefined ? 0 : parseInt(str);
|
175
|
+
})() }, (() => {
|
176
|
+
const str = match[4];
|
177
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
178
|
+
})());
|
179
|
+
const initialStr = stringify(semVer);
|
180
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
181
|
+
enumerable: true,
|
182
|
+
get: function () {
|
183
|
+
const currentStr = stringify(this);
|
184
|
+
if (currentStr !== initialStr) {
|
185
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
186
|
+
}
|
187
|
+
return versionStr;
|
188
|
+
}
|
189
|
+
});
|
190
|
+
return semVer;
|
191
|
+
}
|
192
|
+
SemVer.parse = parse;
|
193
|
+
function stringify(v) {
|
194
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
195
|
+
}
|
196
|
+
SemVer.stringify = stringify;
|
197
|
+
/**
|
198
|
+
*
|
199
|
+
* v1 < v2 => -1
|
200
|
+
* v1 === v2 => 0
|
201
|
+
* v1 > v2 => 1
|
202
|
+
*
|
203
|
+
*/
|
204
|
+
function compare(v1, v2) {
|
205
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
206
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
207
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
208
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
209
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
210
|
+
}
|
211
|
+
}
|
212
|
+
return 0;
|
213
|
+
}
|
214
|
+
SemVer.compare = compare;
|
215
|
+
/*
|
216
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
217
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
218
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
219
|
+
*/
|
220
|
+
function bumpType(params) {
|
221
|
+
const versionAhead = typeof params.versionAhead === "string"
|
222
|
+
? parse(params.versionAhead)
|
223
|
+
: params.versionAhead;
|
224
|
+
const versionBehind = typeof params.versionBehind === "string"
|
225
|
+
? parse(params.versionBehind)
|
226
|
+
: params.versionBehind;
|
227
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
228
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
229
|
+
}
|
230
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
231
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
232
|
+
return level;
|
233
|
+
}
|
234
|
+
}
|
235
|
+
return "no bump";
|
236
|
+
}
|
237
|
+
SemVer.bumpType = bumpType;
|
238
|
+
})(SemVer || (SemVer = {}));
|
239
|
+
//# sourceMappingURL=SemVer.js.map
|
240
|
+
|
241
|
+
/***/ }),
|
242
|
+
|
158
243
|
/***/ 89693:
|
159
244
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
160
245
|
|
package/bin/490.index.js
CHANGED
@@ -501,6 +501,91 @@ async function getLatestsSemVersionedTag(_a) {
|
|
501
501
|
|
502
502
|
/***/ }),
|
503
503
|
|
504
|
+
/***/ 12171:
|
505
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
506
|
+
|
507
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
508
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
509
|
+
/* harmony export */ });
|
510
|
+
var SemVer;
|
511
|
+
(function (SemVer) {
|
512
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
513
|
+
function parse(versionStr) {
|
514
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
515
|
+
if (!match) {
|
516
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
517
|
+
}
|
518
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
519
|
+
const str = match[3];
|
520
|
+
return str === undefined ? 0 : parseInt(str);
|
521
|
+
})() }, (() => {
|
522
|
+
const str = match[4];
|
523
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
524
|
+
})());
|
525
|
+
const initialStr = stringify(semVer);
|
526
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
527
|
+
enumerable: true,
|
528
|
+
get: function () {
|
529
|
+
const currentStr = stringify(this);
|
530
|
+
if (currentStr !== initialStr) {
|
531
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
532
|
+
}
|
533
|
+
return versionStr;
|
534
|
+
}
|
535
|
+
});
|
536
|
+
return semVer;
|
537
|
+
}
|
538
|
+
SemVer.parse = parse;
|
539
|
+
function stringify(v) {
|
540
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
541
|
+
}
|
542
|
+
SemVer.stringify = stringify;
|
543
|
+
/**
|
544
|
+
*
|
545
|
+
* v1 < v2 => -1
|
546
|
+
* v1 === v2 => 0
|
547
|
+
* v1 > v2 => 1
|
548
|
+
*
|
549
|
+
*/
|
550
|
+
function compare(v1, v2) {
|
551
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
552
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
553
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
554
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
555
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
556
|
+
}
|
557
|
+
}
|
558
|
+
return 0;
|
559
|
+
}
|
560
|
+
SemVer.compare = compare;
|
561
|
+
/*
|
562
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
563
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
564
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
565
|
+
*/
|
566
|
+
function bumpType(params) {
|
567
|
+
const versionAhead = typeof params.versionAhead === "string"
|
568
|
+
? parse(params.versionAhead)
|
569
|
+
: params.versionAhead;
|
570
|
+
const versionBehind = typeof params.versionBehind === "string"
|
571
|
+
? parse(params.versionBehind)
|
572
|
+
: params.versionBehind;
|
573
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
574
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
575
|
+
}
|
576
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
577
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
578
|
+
return level;
|
579
|
+
}
|
580
|
+
}
|
581
|
+
return "no bump";
|
582
|
+
}
|
583
|
+
SemVer.bumpType = bumpType;
|
584
|
+
})(SemVer || (SemVer = {}));
|
585
|
+
//# sourceMappingURL=SemVer.js.map
|
586
|
+
|
587
|
+
/***/ }),
|
588
|
+
|
504
589
|
/***/ 38367:
|
505
590
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
506
591
|
|
package/bin/573.index.js
CHANGED
@@ -1533,6 +1533,91 @@ async function command(params) {
|
|
1533
1533
|
|
1534
1534
|
/***/ }),
|
1535
1535
|
|
1536
|
+
/***/ 12171:
|
1537
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
1538
|
+
|
1539
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
1540
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
1541
|
+
/* harmony export */ });
|
1542
|
+
var SemVer;
|
1543
|
+
(function (SemVer) {
|
1544
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
1545
|
+
function parse(versionStr) {
|
1546
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
1547
|
+
if (!match) {
|
1548
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
1549
|
+
}
|
1550
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
1551
|
+
const str = match[3];
|
1552
|
+
return str === undefined ? 0 : parseInt(str);
|
1553
|
+
})() }, (() => {
|
1554
|
+
const str = match[4];
|
1555
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
1556
|
+
})());
|
1557
|
+
const initialStr = stringify(semVer);
|
1558
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
1559
|
+
enumerable: true,
|
1560
|
+
get: function () {
|
1561
|
+
const currentStr = stringify(this);
|
1562
|
+
if (currentStr !== initialStr) {
|
1563
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
1564
|
+
}
|
1565
|
+
return versionStr;
|
1566
|
+
}
|
1567
|
+
});
|
1568
|
+
return semVer;
|
1569
|
+
}
|
1570
|
+
SemVer.parse = parse;
|
1571
|
+
function stringify(v) {
|
1572
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
1573
|
+
}
|
1574
|
+
SemVer.stringify = stringify;
|
1575
|
+
/**
|
1576
|
+
*
|
1577
|
+
* v1 < v2 => -1
|
1578
|
+
* v1 === v2 => 0
|
1579
|
+
* v1 > v2 => 1
|
1580
|
+
*
|
1581
|
+
*/
|
1582
|
+
function compare(v1, v2) {
|
1583
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
1584
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
1585
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
1586
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
1587
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
1588
|
+
}
|
1589
|
+
}
|
1590
|
+
return 0;
|
1591
|
+
}
|
1592
|
+
SemVer.compare = compare;
|
1593
|
+
/*
|
1594
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
1595
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
1596
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
1597
|
+
*/
|
1598
|
+
function bumpType(params) {
|
1599
|
+
const versionAhead = typeof params.versionAhead === "string"
|
1600
|
+
? parse(params.versionAhead)
|
1601
|
+
: params.versionAhead;
|
1602
|
+
const versionBehind = typeof params.versionBehind === "string"
|
1603
|
+
? parse(params.versionBehind)
|
1604
|
+
: params.versionBehind;
|
1605
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
1606
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
1607
|
+
}
|
1608
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
1609
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
1610
|
+
return level;
|
1611
|
+
}
|
1612
|
+
}
|
1613
|
+
return "no bump";
|
1614
|
+
}
|
1615
|
+
SemVer.bumpType = bumpType;
|
1616
|
+
})(SemVer || (SemVer = {}));
|
1617
|
+
//# sourceMappingURL=SemVer.js.map
|
1618
|
+
|
1619
|
+
/***/ }),
|
1620
|
+
|
1536
1621
|
/***/ 27190:
|
1537
1622
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
1538
1623
|
|
package/bin/653.index.js
CHANGED
@@ -250,6 +250,91 @@ async function command(params) {
|
|
250
250
|
|
251
251
|
/***/ }),
|
252
252
|
|
253
|
+
/***/ 12171:
|
254
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
255
|
+
|
256
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
257
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
258
|
+
/* harmony export */ });
|
259
|
+
var SemVer;
|
260
|
+
(function (SemVer) {
|
261
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
262
|
+
function parse(versionStr) {
|
263
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
264
|
+
if (!match) {
|
265
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
266
|
+
}
|
267
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
268
|
+
const str = match[3];
|
269
|
+
return str === undefined ? 0 : parseInt(str);
|
270
|
+
})() }, (() => {
|
271
|
+
const str = match[4];
|
272
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
273
|
+
})());
|
274
|
+
const initialStr = stringify(semVer);
|
275
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
276
|
+
enumerable: true,
|
277
|
+
get: function () {
|
278
|
+
const currentStr = stringify(this);
|
279
|
+
if (currentStr !== initialStr) {
|
280
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
281
|
+
}
|
282
|
+
return versionStr;
|
283
|
+
}
|
284
|
+
});
|
285
|
+
return semVer;
|
286
|
+
}
|
287
|
+
SemVer.parse = parse;
|
288
|
+
function stringify(v) {
|
289
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
290
|
+
}
|
291
|
+
SemVer.stringify = stringify;
|
292
|
+
/**
|
293
|
+
*
|
294
|
+
* v1 < v2 => -1
|
295
|
+
* v1 === v2 => 0
|
296
|
+
* v1 > v2 => 1
|
297
|
+
*
|
298
|
+
*/
|
299
|
+
function compare(v1, v2) {
|
300
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
301
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
302
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
303
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
304
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
305
|
+
}
|
306
|
+
}
|
307
|
+
return 0;
|
308
|
+
}
|
309
|
+
SemVer.compare = compare;
|
310
|
+
/*
|
311
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
312
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
313
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
314
|
+
*/
|
315
|
+
function bumpType(params) {
|
316
|
+
const versionAhead = typeof params.versionAhead === "string"
|
317
|
+
? parse(params.versionAhead)
|
318
|
+
: params.versionAhead;
|
319
|
+
const versionBehind = typeof params.versionBehind === "string"
|
320
|
+
? parse(params.versionBehind)
|
321
|
+
: params.versionBehind;
|
322
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
323
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
324
|
+
}
|
325
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
326
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
327
|
+
return level;
|
328
|
+
}
|
329
|
+
}
|
330
|
+
return "no bump";
|
331
|
+
}
|
332
|
+
SemVer.bumpType = bumpType;
|
333
|
+
})(SemVer || (SemVer = {}));
|
334
|
+
//# sourceMappingURL=SemVer.js.map
|
335
|
+
|
336
|
+
/***/ }),
|
337
|
+
|
253
338
|
/***/ 89693:
|
254
339
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
255
340
|
|
package/bin/658.index.js
CHANGED
@@ -82,6 +82,91 @@ async function command(params) {
|
|
82
82
|
|
83
83
|
/***/ }),
|
84
84
|
|
85
|
+
/***/ 12171:
|
86
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
87
|
+
|
88
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
89
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
90
|
+
/* harmony export */ });
|
91
|
+
var SemVer;
|
92
|
+
(function (SemVer) {
|
93
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
94
|
+
function parse(versionStr) {
|
95
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
96
|
+
if (!match) {
|
97
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
98
|
+
}
|
99
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
100
|
+
const str = match[3];
|
101
|
+
return str === undefined ? 0 : parseInt(str);
|
102
|
+
})() }, (() => {
|
103
|
+
const str = match[4];
|
104
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
105
|
+
})());
|
106
|
+
const initialStr = stringify(semVer);
|
107
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
108
|
+
enumerable: true,
|
109
|
+
get: function () {
|
110
|
+
const currentStr = stringify(this);
|
111
|
+
if (currentStr !== initialStr) {
|
112
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
113
|
+
}
|
114
|
+
return versionStr;
|
115
|
+
}
|
116
|
+
});
|
117
|
+
return semVer;
|
118
|
+
}
|
119
|
+
SemVer.parse = parse;
|
120
|
+
function stringify(v) {
|
121
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
122
|
+
}
|
123
|
+
SemVer.stringify = stringify;
|
124
|
+
/**
|
125
|
+
*
|
126
|
+
* v1 < v2 => -1
|
127
|
+
* v1 === v2 => 0
|
128
|
+
* v1 > v2 => 1
|
129
|
+
*
|
130
|
+
*/
|
131
|
+
function compare(v1, v2) {
|
132
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
133
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
134
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
135
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
136
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
137
|
+
}
|
138
|
+
}
|
139
|
+
return 0;
|
140
|
+
}
|
141
|
+
SemVer.compare = compare;
|
142
|
+
/*
|
143
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
144
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
145
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
146
|
+
*/
|
147
|
+
function bumpType(params) {
|
148
|
+
const versionAhead = typeof params.versionAhead === "string"
|
149
|
+
? parse(params.versionAhead)
|
150
|
+
: params.versionAhead;
|
151
|
+
const versionBehind = typeof params.versionBehind === "string"
|
152
|
+
? parse(params.versionBehind)
|
153
|
+
: params.versionBehind;
|
154
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
155
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
156
|
+
}
|
157
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
158
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
159
|
+
return level;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
return "no bump";
|
163
|
+
}
|
164
|
+
SemVer.bumpType = bumpType;
|
165
|
+
})(SemVer || (SemVer = {}));
|
166
|
+
//# sourceMappingURL=SemVer.js.map
|
167
|
+
|
168
|
+
/***/ }),
|
169
|
+
|
85
170
|
/***/ 89693:
|
86
171
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
87
172
|
|
package/bin/682.index.js
CHANGED
@@ -407,12 +407,12 @@ async function getSupportedDockerImageTags(params) {
|
|
407
407
|
return result;
|
408
408
|
}
|
409
409
|
}
|
410
|
-
const
|
410
|
+
const tags_queryResponse = [];
|
411
411
|
await (async function callee(url) {
|
412
412
|
const r = await lib_default()(url, buildContext.fetchOptions);
|
413
413
|
await Promise.all([
|
414
414
|
(async () => {
|
415
|
-
|
415
|
+
tags_queryResponse.push(...lib.z.object({
|
416
416
|
tags: lib.z.array(lib.z.string())
|
417
417
|
})
|
418
418
|
.parse(await r.json()).tags);
|
@@ -432,7 +432,8 @@ async function getSupportedDockerImageTags(params) {
|
|
432
432
|
})()
|
433
433
|
]);
|
434
434
|
})("https://quay.io/v2/keycloak/keycloak/tags/list");
|
435
|
-
const
|
435
|
+
const supportedKeycloakMajorVersions = getSupportedKeycloakMajorVersions();
|
436
|
+
const allSupportedTags_withVersion = tags_queryResponse
|
436
437
|
.map(tag => ({
|
437
438
|
tag,
|
438
439
|
version: (() => {
|
@@ -446,21 +447,27 @@ async function getSupportedDockerImageTags(params) {
|
|
446
447
|
catch (_a) {
|
447
448
|
return undefined;
|
448
449
|
}
|
450
|
+
if (tag.split(".").length !== 3) {
|
451
|
+
return undefined;
|
452
|
+
}
|
453
|
+
if (!supportedKeycloakMajorVersions.includes(version.major)) {
|
454
|
+
return undefined;
|
455
|
+
}
|
449
456
|
return version;
|
450
457
|
})()
|
451
458
|
}))
|
452
459
|
.map(({ tag, version }) => (version === undefined ? undefined : { tag, version }))
|
453
|
-
.filter((0,exclude/* exclude */.D)(undefined))
|
454
|
-
|
455
|
-
|
456
|
-
|
460
|
+
.filter((0,exclude/* exclude */.D)(undefined))
|
461
|
+
.sort(({ version: a }, { version: b }) => SemVer/* SemVer.compare */.h.compare(b, a));
|
462
|
+
const latestTagByMajor = {};
|
463
|
+
for (const { version } of allSupportedTags_withVersion) {
|
464
|
+
const version_current = latestTagByMajor[version.major];
|
457
465
|
if (version_current === undefined ||
|
458
466
|
SemVer/* SemVer.compare */.h.compare(version_current, version) === -1) {
|
459
|
-
|
467
|
+
latestTagByMajor[version.major] = version;
|
460
468
|
}
|
461
469
|
}
|
462
|
-
const
|
463
|
-
const result = Object.entries(versionByMajor)
|
470
|
+
const latestMajorTags = Object.entries(latestTagByMajor)
|
464
471
|
.sort(([a], [b]) => parseInt(b) - parseInt(a))
|
465
472
|
.map(([, version]) => version)
|
466
473
|
.map(version => {
|
@@ -471,15 +478,28 @@ async function getSupportedDockerImageTags(params) {
|
|
471
478
|
return SemVer/* SemVer.stringify */.h.stringify(version);
|
472
479
|
})
|
473
480
|
.filter((0,exclude/* exclude */.D)(undefined));
|
481
|
+
const allSupportedTags = allSupportedTags_withVersion.map(({ tag }) => tag);
|
482
|
+
const result = {
|
483
|
+
latestMajorTags,
|
484
|
+
allSupportedTags
|
485
|
+
};
|
474
486
|
await setCachedValue({ cacheDirPath: buildContext.cacheDirPath, result });
|
475
487
|
return result;
|
476
488
|
}
|
477
489
|
const { getCachedValue, setCachedValue } = (() => {
|
490
|
+
const zResult = (() => {
|
491
|
+
const zTargetType = lib.z.object({
|
492
|
+
allSupportedTags: lib.z.array(lib.z.string()),
|
493
|
+
latestMajorTags: lib.z.array(lib.z.string())
|
494
|
+
});
|
495
|
+
assert/* assert */.h;
|
496
|
+
return (0,id.id)(zTargetType);
|
497
|
+
})();
|
478
498
|
const zCache = (() => {
|
479
499
|
const zTargetType = lib.z.object({
|
480
500
|
keycloakifyVersion: lib.z.string(),
|
481
501
|
time: lib.z.number(),
|
482
|
-
result:
|
502
|
+
result: zResult
|
483
503
|
});
|
484
504
|
assert/* assert */.h;
|
485
505
|
return (0,id.id)(zTargetType);
|
@@ -1077,13 +1097,13 @@ async function command(params) {
|
|
1077
1097
|
process.exit(1);
|
1078
1098
|
}
|
1079
1099
|
const { cliCommandOptions, buildContext } = params;
|
1080
|
-
const
|
1100
|
+
const { allSupportedTags, latestMajorTags } = await getSupportedDockerImageTags({
|
1081
1101
|
buildContext
|
1082
1102
|
});
|
1083
1103
|
const { dockerImageTag } = await (async () => {
|
1084
1104
|
if (cliCommandOptions.keycloakVersion !== undefined) {
|
1085
1105
|
const cliCommandOptions_keycloakVersion = cliCommandOptions.keycloakVersion;
|
1086
|
-
const tag =
|
1106
|
+
const tag = allSupportedTags.find(tag => tag.startsWith(cliCommandOptions_keycloakVersion));
|
1087
1107
|
if (tag === undefined) {
|
1088
1108
|
console.log(source_default().red([
|
1089
1109
|
`We could not find a Keycloak Docker image for ${cliCommandOptions_keycloakVersion}`,
|
@@ -1103,7 +1123,7 @@ async function command(params) {
|
|
1103
1123
|
source_default().gray("You can also explicitly provide the version with `npx keycloakify start-keycloak --keycloak-version 26` (or any other version)")
|
1104
1124
|
].join("\n"));
|
1105
1125
|
const { value: tag } = await dist_default()({
|
1106
|
-
values:
|
1126
|
+
values: latestMajorTags
|
1107
1127
|
}).catch(() => {
|
1108
1128
|
process.exit(-1);
|
1109
1129
|
});
|
@@ -1458,6 +1478,91 @@ async function command(params) {
|
|
1458
1478
|
|
1459
1479
|
/***/ }),
|
1460
1480
|
|
1481
|
+
/***/ 12171:
|
1482
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
1483
|
+
|
1484
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
1485
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
1486
|
+
/* harmony export */ });
|
1487
|
+
var SemVer;
|
1488
|
+
(function (SemVer) {
|
1489
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
1490
|
+
function parse(versionStr) {
|
1491
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
1492
|
+
if (!match) {
|
1493
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
1494
|
+
}
|
1495
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
1496
|
+
const str = match[3];
|
1497
|
+
return str === undefined ? 0 : parseInt(str);
|
1498
|
+
})() }, (() => {
|
1499
|
+
const str = match[4];
|
1500
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
1501
|
+
})());
|
1502
|
+
const initialStr = stringify(semVer);
|
1503
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
1504
|
+
enumerable: true,
|
1505
|
+
get: function () {
|
1506
|
+
const currentStr = stringify(this);
|
1507
|
+
if (currentStr !== initialStr) {
|
1508
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
1509
|
+
}
|
1510
|
+
return versionStr;
|
1511
|
+
}
|
1512
|
+
});
|
1513
|
+
return semVer;
|
1514
|
+
}
|
1515
|
+
SemVer.parse = parse;
|
1516
|
+
function stringify(v) {
|
1517
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
1518
|
+
}
|
1519
|
+
SemVer.stringify = stringify;
|
1520
|
+
/**
|
1521
|
+
*
|
1522
|
+
* v1 < v2 => -1
|
1523
|
+
* v1 === v2 => 0
|
1524
|
+
* v1 > v2 => 1
|
1525
|
+
*
|
1526
|
+
*/
|
1527
|
+
function compare(v1, v2) {
|
1528
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
1529
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
1530
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
1531
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
1532
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
1533
|
+
}
|
1534
|
+
}
|
1535
|
+
return 0;
|
1536
|
+
}
|
1537
|
+
SemVer.compare = compare;
|
1538
|
+
/*
|
1539
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
1540
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
1541
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
1542
|
+
*/
|
1543
|
+
function bumpType(params) {
|
1544
|
+
const versionAhead = typeof params.versionAhead === "string"
|
1545
|
+
? parse(params.versionAhead)
|
1546
|
+
: params.versionAhead;
|
1547
|
+
const versionBehind = typeof params.versionBehind === "string"
|
1548
|
+
? parse(params.versionBehind)
|
1549
|
+
: params.versionBehind;
|
1550
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
1551
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
1552
|
+
}
|
1553
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
1554
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
1555
|
+
return level;
|
1556
|
+
}
|
1557
|
+
}
|
1558
|
+
return "no bump";
|
1559
|
+
}
|
1560
|
+
SemVer.bumpType = bumpType;
|
1561
|
+
})(SemVer || (SemVer = {}));
|
1562
|
+
//# sourceMappingURL=SemVer.js.map
|
1563
|
+
|
1564
|
+
/***/ }),
|
1565
|
+
|
1461
1566
|
/***/ 38367:
|
1462
1567
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
1463
1568
|
|
package/bin/735.index.js
CHANGED
@@ -402,6 +402,91 @@ async function getLatestsSemVersionedTag(_a) {
|
|
402
402
|
|
403
403
|
/***/ }),
|
404
404
|
|
405
|
+
/***/ 12171:
|
406
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
407
|
+
|
408
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
409
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
410
|
+
/* harmony export */ });
|
411
|
+
var SemVer;
|
412
|
+
(function (SemVer) {
|
413
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
414
|
+
function parse(versionStr) {
|
415
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
416
|
+
if (!match) {
|
417
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
418
|
+
}
|
419
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
420
|
+
const str = match[3];
|
421
|
+
return str === undefined ? 0 : parseInt(str);
|
422
|
+
})() }, (() => {
|
423
|
+
const str = match[4];
|
424
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
425
|
+
})());
|
426
|
+
const initialStr = stringify(semVer);
|
427
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
428
|
+
enumerable: true,
|
429
|
+
get: function () {
|
430
|
+
const currentStr = stringify(this);
|
431
|
+
if (currentStr !== initialStr) {
|
432
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
433
|
+
}
|
434
|
+
return versionStr;
|
435
|
+
}
|
436
|
+
});
|
437
|
+
return semVer;
|
438
|
+
}
|
439
|
+
SemVer.parse = parse;
|
440
|
+
function stringify(v) {
|
441
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
442
|
+
}
|
443
|
+
SemVer.stringify = stringify;
|
444
|
+
/**
|
445
|
+
*
|
446
|
+
* v1 < v2 => -1
|
447
|
+
* v1 === v2 => 0
|
448
|
+
* v1 > v2 => 1
|
449
|
+
*
|
450
|
+
*/
|
451
|
+
function compare(v1, v2) {
|
452
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
453
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
454
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
455
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
456
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
457
|
+
}
|
458
|
+
}
|
459
|
+
return 0;
|
460
|
+
}
|
461
|
+
SemVer.compare = compare;
|
462
|
+
/*
|
463
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
464
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
465
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
466
|
+
*/
|
467
|
+
function bumpType(params) {
|
468
|
+
const versionAhead = typeof params.versionAhead === "string"
|
469
|
+
? parse(params.versionAhead)
|
470
|
+
: params.versionAhead;
|
471
|
+
const versionBehind = typeof params.versionBehind === "string"
|
472
|
+
? parse(params.versionBehind)
|
473
|
+
: params.versionBehind;
|
474
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
475
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
476
|
+
}
|
477
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
478
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
479
|
+
return level;
|
480
|
+
}
|
481
|
+
}
|
482
|
+
return "no bump";
|
483
|
+
}
|
484
|
+
SemVer.bumpType = bumpType;
|
485
|
+
})(SemVer || (SemVer = {}));
|
486
|
+
//# sourceMappingURL=SemVer.js.map
|
487
|
+
|
488
|
+
/***/ }),
|
489
|
+
|
405
490
|
/***/ 89693:
|
406
491
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
407
492
|
|
package/bin/main.js
CHANGED
@@ -96,92 +96,6 @@ const TEST_APP_URL = "https://my-theme.keycloakify.dev";
|
|
96
96
|
|
97
97
|
/***/ }),
|
98
98
|
|
99
|
-
/***/ 12171:
|
100
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
101
|
-
|
102
|
-
"use strict";
|
103
|
-
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
104
|
-
/* harmony export */ "h": () => (/* binding */ SemVer)
|
105
|
-
/* harmony export */ });
|
106
|
-
var SemVer;
|
107
|
-
(function (SemVer) {
|
108
|
-
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
109
|
-
function parse(versionStr) {
|
110
|
-
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
111
|
-
if (!match) {
|
112
|
-
throw new Error(`${versionStr} is not a valid semantic version`);
|
113
|
-
}
|
114
|
-
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
115
|
-
const str = match[3];
|
116
|
-
return str === undefined ? 0 : parseInt(str);
|
117
|
-
})() }, (() => {
|
118
|
-
const str = match[4];
|
119
|
-
return str === undefined ? {} : { rc: parseInt(str) };
|
120
|
-
})());
|
121
|
-
const initialStr = stringify(semVer);
|
122
|
-
Object.defineProperty(semVer, "parsedFrom", {
|
123
|
-
enumerable: true,
|
124
|
-
get: function () {
|
125
|
-
const currentStr = stringify(this);
|
126
|
-
if (currentStr !== initialStr) {
|
127
|
-
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
128
|
-
}
|
129
|
-
return versionStr;
|
130
|
-
}
|
131
|
-
});
|
132
|
-
return semVer;
|
133
|
-
}
|
134
|
-
SemVer.parse = parse;
|
135
|
-
function stringify(v) {
|
136
|
-
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
137
|
-
}
|
138
|
-
SemVer.stringify = stringify;
|
139
|
-
/**
|
140
|
-
*
|
141
|
-
* v1 < v2 => -1
|
142
|
-
* v1 === v2 => 0
|
143
|
-
* v1 > v2 => 1
|
144
|
-
*
|
145
|
-
*/
|
146
|
-
function compare(v1, v2) {
|
147
|
-
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
148
|
-
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
149
|
-
for (const level of ["major", "minor", "patch", "rc"]) {
|
150
|
-
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
151
|
-
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
152
|
-
}
|
153
|
-
}
|
154
|
-
return 0;
|
155
|
-
}
|
156
|
-
SemVer.compare = compare;
|
157
|
-
/*
|
158
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
159
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
160
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
161
|
-
*/
|
162
|
-
function bumpType(params) {
|
163
|
-
const versionAhead = typeof params.versionAhead === "string"
|
164
|
-
? parse(params.versionAhead)
|
165
|
-
: params.versionAhead;
|
166
|
-
const versionBehind = typeof params.versionBehind === "string"
|
167
|
-
? parse(params.versionBehind)
|
168
|
-
: params.versionBehind;
|
169
|
-
if (compare(versionBehind, versionAhead) === 1) {
|
170
|
-
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
171
|
-
}
|
172
|
-
for (const level of ["major", "minor", "patch", "rc"]) {
|
173
|
-
if (versionBehind[level] !== versionAhead[level]) {
|
174
|
-
return level;
|
175
|
-
}
|
176
|
-
}
|
177
|
-
return "no bump";
|
178
|
-
}
|
179
|
-
SemVer.bumpType = bumpType;
|
180
|
-
})(SemVer || (SemVer = {}));
|
181
|
-
//# sourceMappingURL=SemVer.js.map
|
182
|
-
|
183
|
-
/***/ }),
|
184
|
-
|
185
99
|
/***/ 73036:
|
186
100
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
187
101
|
|
@@ -16190,17 +16104,12 @@ function getBuildContext(params) {
|
|
16190
16104
|
};
|
16191
16105
|
}
|
16192
16106
|
//# sourceMappingURL=buildContext.js.map
|
16193
|
-
// EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
|
16194
|
-
var SemVer = __nccwpck_require__(12171);
|
16195
16107
|
;// CONCATENATED MODULE: ./dist/bin/main.js
|
16196
16108
|
|
16197
16109
|
|
16198
16110
|
|
16199
16111
|
|
16200
16112
|
|
16201
|
-
|
16202
|
-
|
16203
|
-
|
16204
16113
|
assertNoPnpmDlx();
|
16205
16114
|
const program = Z({
|
16206
16115
|
name: "keycloakify",
|
@@ -16293,36 +16202,10 @@ program
|
|
16293
16202
|
skip,
|
16294
16203
|
handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
|
16295
16204
|
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(805), __nccwpck_require__.e(525), __nccwpck_require__.e(33), __nccwpck_require__.e(503), __nccwpck_require__.e(682)]).then(__nccwpck_require__.bind(__nccwpck_require__, 6682));
|
16296
|
-
validate_keycloak_version: {
|
16297
|
-
if (keycloakVersion === undefined) {
|
16298
|
-
break validate_keycloak_version;
|
16299
|
-
}
|
16300
|
-
const isValidVersion = (() => {
|
16301
|
-
if (typeof keycloakVersion === "number") {
|
16302
|
-
return false;
|
16303
|
-
}
|
16304
|
-
try {
|
16305
|
-
SemVer/* SemVer.parse */.h.parse(keycloakVersion);
|
16306
|
-
}
|
16307
|
-
catch (_a) {
|
16308
|
-
return false;
|
16309
|
-
}
|
16310
|
-
return;
|
16311
|
-
})();
|
16312
|
-
if (isValidVersion) {
|
16313
|
-
break validate_keycloak_version;
|
16314
|
-
}
|
16315
|
-
console.log(source_default().red([
|
16316
|
-
`Invalid Keycloak version: ${keycloakVersion}`,
|
16317
|
-
"It should be a valid semver version example: 26.0.4"
|
16318
|
-
].join(" ")));
|
16319
|
-
process.exit(1);
|
16320
|
-
}
|
16321
|
-
(0,assert/* assert */.h)((0,assert.is)(keycloakVersion));
|
16322
16205
|
await command({
|
16323
16206
|
buildContext: getBuildContext({ projectDirPath }),
|
16324
16207
|
cliCommandOptions: {
|
16325
|
-
keycloakVersion
|
16208
|
+
keycloakVersion: keycloakVersion === undefined ? undefined : `${keycloakVersion}`,
|
16326
16209
|
port,
|
16327
16210
|
realmJsonFilePath
|
16328
16211
|
}
|
package/package.json
CHANGED
package/src/bin/main.ts
CHANGED
@@ -5,9 +5,6 @@ import { readThisNpmPackageVersion } from "./tools/readThisNpmPackageVersion";
|
|
5
5
|
import * as child_process from "child_process";
|
6
6
|
import { assertNoPnpmDlx } from "./tools/assertNoPnpmDlx";
|
7
7
|
import { getBuildContext } from "./shared/buildContext";
|
8
|
-
import { SemVer } from "./tools/SemVer";
|
9
|
-
import { assert, is } from "tsafe/assert";
|
10
|
-
import chalk from "chalk";
|
11
8
|
|
12
9
|
type CliCommandOptions = {
|
13
10
|
projectDirPath: string | undefined;
|
@@ -137,47 +134,11 @@ program
|
|
137
134
|
handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
|
138
135
|
const { command } = await import("./start-keycloak");
|
139
136
|
|
140
|
-
validate_keycloak_version: {
|
141
|
-
if (keycloakVersion === undefined) {
|
142
|
-
break validate_keycloak_version;
|
143
|
-
}
|
144
|
-
|
145
|
-
const isValidVersion = (() => {
|
146
|
-
if (typeof keycloakVersion === "number") {
|
147
|
-
return false;
|
148
|
-
}
|
149
|
-
|
150
|
-
try {
|
151
|
-
SemVer.parse(keycloakVersion);
|
152
|
-
} catch {
|
153
|
-
return false;
|
154
|
-
}
|
155
|
-
|
156
|
-
return;
|
157
|
-
})();
|
158
|
-
|
159
|
-
if (isValidVersion) {
|
160
|
-
break validate_keycloak_version;
|
161
|
-
}
|
162
|
-
|
163
|
-
console.log(
|
164
|
-
chalk.red(
|
165
|
-
[
|
166
|
-
`Invalid Keycloak version: ${keycloakVersion}`,
|
167
|
-
"It should be a valid semver version example: 26.0.4"
|
168
|
-
].join(" ")
|
169
|
-
)
|
170
|
-
);
|
171
|
-
|
172
|
-
process.exit(1);
|
173
|
-
}
|
174
|
-
|
175
|
-
assert(is<string | undefined>(keycloakVersion));
|
176
|
-
|
177
137
|
await command({
|
178
138
|
buildContext: getBuildContext({ projectDirPath }),
|
179
139
|
cliCommandOptions: {
|
180
|
-
keycloakVersion
|
140
|
+
keycloakVersion:
|
141
|
+
keycloakVersion === undefined ? undefined : `${keycloakVersion}`,
|
181
142
|
port,
|
182
143
|
realmJsonFilePath
|
183
144
|
}
|
@@ -10,6 +10,7 @@ import { join as pathJoin, dirname as pathDirname } from "path";
|
|
10
10
|
import * as fs from "fs/promises";
|
11
11
|
import { existsAsync } from "../tools/fs.existsAsync";
|
12
12
|
import { readThisNpmPackageVersion } from "../tools/readThisNpmPackageVersion";
|
13
|
+
import type { ReturnType } from "tsafe";
|
13
14
|
|
14
15
|
export type BuildContextLike = {
|
15
16
|
fetchOptions: BuildContext["fetchOptions"];
|
@@ -20,7 +21,10 @@ assert<BuildContext extends BuildContextLike ? true : false>;
|
|
20
21
|
|
21
22
|
export async function getSupportedDockerImageTags(params: {
|
22
23
|
buildContext: BuildContextLike;
|
23
|
-
}) {
|
24
|
+
}): Promise<{
|
25
|
+
allSupportedTags: string[];
|
26
|
+
latestMajorTags: string[];
|
27
|
+
}> {
|
24
28
|
const { buildContext } = params;
|
25
29
|
|
26
30
|
{
|
@@ -31,14 +35,14 @@ export async function getSupportedDockerImageTags(params: {
|
|
31
35
|
}
|
32
36
|
}
|
33
37
|
|
34
|
-
const
|
38
|
+
const tags_queryResponse: string[] = [];
|
35
39
|
|
36
40
|
await (async function callee(url: string) {
|
37
41
|
const r = await fetch(url, buildContext.fetchOptions);
|
38
42
|
|
39
43
|
await Promise.all([
|
40
44
|
(async () => {
|
41
|
-
|
45
|
+
tags_queryResponse.push(
|
42
46
|
...z
|
43
47
|
.object({
|
44
48
|
tags: z.array(z.string())
|
@@ -70,7 +74,9 @@ export async function getSupportedDockerImageTags(params: {
|
|
70
74
|
]);
|
71
75
|
})("https://quay.io/v2/keycloak/keycloak/tags/list");
|
72
76
|
|
73
|
-
const
|
77
|
+
const supportedKeycloakMajorVersions = getSupportedKeycloakMajorVersions();
|
78
|
+
|
79
|
+
const allSupportedTags_withVersion = tags_queryResponse
|
74
80
|
.map(tag => ({
|
75
81
|
tag,
|
76
82
|
version: (() => {
|
@@ -86,28 +92,35 @@ export async function getSupportedDockerImageTags(params: {
|
|
86
92
|
return undefined;
|
87
93
|
}
|
88
94
|
|
95
|
+
if (tag.split(".").length !== 3) {
|
96
|
+
return undefined;
|
97
|
+
}
|
98
|
+
|
99
|
+
if (!supportedKeycloakMajorVersions.includes(version.major)) {
|
100
|
+
return undefined;
|
101
|
+
}
|
102
|
+
|
89
103
|
return version;
|
90
104
|
})()
|
91
105
|
}))
|
92
106
|
.map(({ tag, version }) => (version === undefined ? undefined : { tag, version }))
|
93
|
-
.filter(exclude(undefined))
|
107
|
+
.filter(exclude(undefined))
|
108
|
+
.sort(({ version: a }, { version: b }) => SemVer.compare(b, a));
|
94
109
|
|
95
|
-
const
|
110
|
+
const latestTagByMajor: Record<number, SemVer | undefined> = {};
|
96
111
|
|
97
|
-
for (const { version } of
|
98
|
-
const version_current =
|
112
|
+
for (const { version } of allSupportedTags_withVersion) {
|
113
|
+
const version_current = latestTagByMajor[version.major];
|
99
114
|
|
100
115
|
if (
|
101
116
|
version_current === undefined ||
|
102
117
|
SemVer.compare(version_current, version) === -1
|
103
118
|
) {
|
104
|
-
|
119
|
+
latestTagByMajor[version.major] = version;
|
105
120
|
}
|
106
121
|
}
|
107
122
|
|
108
|
-
const
|
109
|
-
|
110
|
-
const result = Object.entries(versionByMajor)
|
123
|
+
const latestMajorTags = Object.entries(latestTagByMajor)
|
111
124
|
.sort(([a], [b]) => parseInt(b) - parseInt(a))
|
112
125
|
.map(([, version]) => version)
|
113
126
|
.map(version => {
|
@@ -121,16 +134,40 @@ export async function getSupportedDockerImageTags(params: {
|
|
121
134
|
})
|
122
135
|
.filter(exclude(undefined));
|
123
136
|
|
137
|
+
const allSupportedTags = allSupportedTags_withVersion.map(({ tag }) => tag);
|
138
|
+
|
139
|
+
const result = {
|
140
|
+
latestMajorTags,
|
141
|
+
allSupportedTags
|
142
|
+
};
|
143
|
+
|
124
144
|
await setCachedValue({ cacheDirPath: buildContext.cacheDirPath, result });
|
125
145
|
|
126
146
|
return result;
|
127
147
|
}
|
128
148
|
|
129
149
|
const { getCachedValue, setCachedValue } = (() => {
|
150
|
+
type Result = ReturnType<typeof getSupportedDockerImageTags>;
|
151
|
+
|
152
|
+
const zResult = (() => {
|
153
|
+
type TargetType = Result;
|
154
|
+
|
155
|
+
const zTargetType = z.object({
|
156
|
+
allSupportedTags: z.array(z.string()),
|
157
|
+
latestMajorTags: z.array(z.string())
|
158
|
+
});
|
159
|
+
|
160
|
+
type InferredType = z.infer<typeof zTargetType>;
|
161
|
+
|
162
|
+
assert<Equals<TargetType, InferredType>>;
|
163
|
+
|
164
|
+
return id<z.ZodType<TargetType>>(zTargetType);
|
165
|
+
})();
|
166
|
+
|
130
167
|
type Cache = {
|
131
168
|
keycloakifyVersion: string;
|
132
169
|
time: number;
|
133
|
-
result:
|
170
|
+
result: Result;
|
134
171
|
};
|
135
172
|
|
136
173
|
const zCache = (() => {
|
@@ -139,7 +176,7 @@ const { getCachedValue, setCachedValue } = (() => {
|
|
139
176
|
const zTargetType = z.object({
|
140
177
|
keycloakifyVersion: z.string(),
|
141
178
|
time: z.number(),
|
142
|
-
result:
|
179
|
+
result: zResult
|
143
180
|
});
|
144
181
|
|
145
182
|
type InferredType = z.infer<typeof zTargetType>;
|
@@ -97,7 +97,7 @@ export async function command(params: {
|
|
97
97
|
|
98
98
|
const { cliCommandOptions, buildContext } = params;
|
99
99
|
|
100
|
-
const
|
100
|
+
const { allSupportedTags, latestMajorTags } = await getSupportedDockerImageTags({
|
101
101
|
buildContext
|
102
102
|
});
|
103
103
|
|
@@ -105,7 +105,7 @@ export async function command(params: {
|
|
105
105
|
if (cliCommandOptions.keycloakVersion !== undefined) {
|
106
106
|
const cliCommandOptions_keycloakVersion = cliCommandOptions.keycloakVersion;
|
107
107
|
|
108
|
-
const tag =
|
108
|
+
const tag = allSupportedTags.find(tag =>
|
109
109
|
tag.startsWith(cliCommandOptions_keycloakVersion)
|
110
110
|
);
|
111
111
|
|
@@ -143,7 +143,7 @@ export async function command(params: {
|
|
143
143
|
);
|
144
144
|
|
145
145
|
const { value: tag } = await cliSelect<string>({
|
146
|
-
values:
|
146
|
+
values: latestMajorTags
|
147
147
|
}).catch(() => {
|
148
148
|
process.exit(-1);
|
149
149
|
});
|