@jeffusion/bungee-core 6.3.1 → 6.4.1
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.
|
@@ -533,7 +533,37 @@ function pluginConfigConstraintSatisfied(options, constraint) {
|
|
|
533
533
|
return constraint.tuples.some((tuple) => tuple.length === values.length && tuple.every((value, index) => value === values[index]));
|
|
534
534
|
}
|
|
535
535
|
// ../types/src/menus.ts
|
|
536
|
+
var MENU_MANAGEMENT_ID = "builtin:menus";
|
|
536
537
|
var SYSTEM_MENU_GROUP_ID = "group:system";
|
|
538
|
+
var DEFAULT_MENU_GROUPS = [
|
|
539
|
+
{
|
|
540
|
+
id: "group:gateway",
|
|
541
|
+
label: "menus.groups.gateway",
|
|
542
|
+
icon: "lucide:network",
|
|
543
|
+
pages: ["builtin:routes", "builtin:services"]
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
id: "group:usage",
|
|
547
|
+
label: "menus.groups.usage",
|
|
548
|
+
icon: "lucide:chart-no-axes-combined",
|
|
549
|
+
pages: ["plugin:token-stats:%2Fstatistics", "plugin:token-budget:%2Fsettings"]
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
id: "group:access",
|
|
553
|
+
label: "menus.groups.access",
|
|
554
|
+
icon: "lucide:shield-check",
|
|
555
|
+
pages: ["plugin:key-access:%2Fsettings", "plugin:user-auth:%2Fusers"]
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
id: SYSTEM_MENU_GROUP_ID,
|
|
559
|
+
label: "header.management",
|
|
560
|
+
icon: "lucide:settings",
|
|
561
|
+
pages: ["builtin:configuration", "builtin:plugins", MENU_MANAGEMENT_ID, "plugin:user-auth:%2Fprofile"]
|
|
562
|
+
}
|
|
563
|
+
];
|
|
564
|
+
function defaultMenuGroup(id) {
|
|
565
|
+
return DEFAULT_MENU_GROUPS.find((group) => group.id === id);
|
|
566
|
+
}
|
|
537
567
|
// src/config-storage/gateway-target-validation.ts
|
|
538
568
|
function validateGatewayTargets(config, schemas, context) {
|
|
539
569
|
if (!schemas)
|
|
@@ -7705,7 +7735,7 @@ function validateMenuLayout(value, allowedPages, requireAvailableIcons = true) {
|
|
|
7705
7735
|
if (node.kind !== "group" || typeof node.id !== "string" || !/^group:[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/.test(node.id) || groups.has(node.id) || typeof node.visible !== "boolean" || !Array.isArray(node.children) || node.children.length > MAX_MENU_PAGES)
|
|
7706
7736
|
invalid();
|
|
7707
7737
|
const title = typeof node.title === "string" ? node.title.trim() : node.title;
|
|
7708
|
-
if (title === null ? node.id
|
|
7738
|
+
if (title === null ? !defaultMenuGroup(node.id) : typeof title !== "string" || !title || title.length > 80 || /[\u0000-\u001f\u007f]/.test(title))
|
|
7709
7739
|
invalid();
|
|
7710
7740
|
if (typeof title === "string" && titles.has(title))
|
|
7711
7741
|
invalid();
|