@inf-monkeys-tech/monkeys 1.0.35 → 1.0.36
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/lib/contracts/tenant.d.ts +291 -4
- package/lib/contracts/tenant.d.ts.map +1 -1
- package/lib/contracts/tenant.js +110 -2
- package/lib/contracts/tenant.js.map +1 -1
- package/lib/esm/contracts/index.mjs +101 -1
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +101 -1
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +90 -1
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +98 -1
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/tenant-product-config.schema.json +148 -2
- package/lib/json-schema/tenant-runtime-config.schema.json +148 -2
- package/lib/schemas/index.d.ts +71 -3
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +11 -2
- package/lib/schemas/index.js.map +1 -1
- package/package.json +1 -1
- package/test/fixtures/current-user-menu-profile.v1.json +22 -0
|
@@ -12077,11 +12077,100 @@ var AssetVariantsSchema = z10.object({
|
|
|
12077
12077
|
light: z10.string().optional(),
|
|
12078
12078
|
dark: z10.string().optional()
|
|
12079
12079
|
}).strict();
|
|
12080
|
+
var LEGACY_CURRENT_USER_MENU_ITEM_IDS = ["dark-mode", "language", "settings", "logout"];
|
|
12081
|
+
var CURRENT_USER_MENU_CONTROL_REFS = ["dark-mode", "language"];
|
|
12082
|
+
var CURRENT_USER_MENU_ACTION_REFS = ["logout"];
|
|
12083
|
+
var CurrentUserMenuIdentifierSchema = z10.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
|
|
12084
|
+
var CurrentUserMenuDisplayTextSchema = z10.union([
|
|
12085
|
+
z10.string().trim().min(1),
|
|
12086
|
+
z10.record(z10.string().trim().min(1), z10.string().trim().min(1)).refine((value) => Object.keys(value).length > 0, "Localized menu text must contain at least one locale.")
|
|
12087
|
+
]);
|
|
12088
|
+
var CurrentUserMenuNavigationItemSchema = z10.object({
|
|
12089
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
12090
|
+
kind: z10.literal("navigation"),
|
|
12091
|
+
ref: CurrentUserMenuIdentifierSchema
|
|
12092
|
+
}).strict();
|
|
12093
|
+
var CurrentUserMenuControlItemSchema = z10.object({
|
|
12094
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
12095
|
+
kind: z10.literal("control"),
|
|
12096
|
+
ref: z10.enum(CURRENT_USER_MENU_CONTROL_REFS)
|
|
12097
|
+
}).strict();
|
|
12098
|
+
var CurrentUserMenuActionItemSchema = z10.object({
|
|
12099
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
12100
|
+
kind: z10.literal("action"),
|
|
12101
|
+
ref: z10.enum(CURRENT_USER_MENU_ACTION_REFS),
|
|
12102
|
+
tone: z10.enum(["default", "danger"]).optional()
|
|
12103
|
+
}).strict();
|
|
12104
|
+
var CurrentUserMenuItemSchema = z10.discriminatedUnion("kind", [
|
|
12105
|
+
CurrentUserMenuNavigationItemSchema,
|
|
12106
|
+
CurrentUserMenuControlItemSchema,
|
|
12107
|
+
CurrentUserMenuActionItemSchema
|
|
12108
|
+
]);
|
|
12109
|
+
var CurrentUserMenuSectionSchema = z10.object({
|
|
12110
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
12111
|
+
label: CurrentUserMenuDisplayTextSchema.optional(),
|
|
12112
|
+
dividerBefore: z10.boolean().optional(),
|
|
12113
|
+
items: z10.array(CurrentUserMenuItemSchema)
|
|
12114
|
+
}).strict();
|
|
12115
|
+
var CurrentUserMenuConfigSchema = z10.object({
|
|
12116
|
+
version: z10.literal(1),
|
|
12117
|
+
sections: z10.array(CurrentUserMenuSectionSchema).max(20)
|
|
12118
|
+
}).strict().superRefine((value, context) => {
|
|
12119
|
+
const sectionIds = /* @__PURE__ */ new Set();
|
|
12120
|
+
const itemIds = /* @__PURE__ */ new Set();
|
|
12121
|
+
let itemCount = 0;
|
|
12122
|
+
value.sections.forEach((section, sectionIndex) => {
|
|
12123
|
+
if (sectionIds.has(section.id)) {
|
|
12124
|
+
context.addIssue({
|
|
12125
|
+
code: "custom",
|
|
12126
|
+
message: `Duplicate current-user menu section id ${section.id}.`,
|
|
12127
|
+
path: ["sections", sectionIndex, "id"]
|
|
12128
|
+
});
|
|
12129
|
+
}
|
|
12130
|
+
sectionIds.add(section.id);
|
|
12131
|
+
itemCount += section.items.length;
|
|
12132
|
+
section.items.forEach((item, itemIndex) => {
|
|
12133
|
+
if (itemIds.has(item.id)) {
|
|
12134
|
+
context.addIssue({
|
|
12135
|
+
code: "custom",
|
|
12136
|
+
message: `Duplicate current-user menu item id ${item.id}.`,
|
|
12137
|
+
path: ["sections", sectionIndex, "items", itemIndex, "id"]
|
|
12138
|
+
});
|
|
12139
|
+
}
|
|
12140
|
+
itemIds.add(item.id);
|
|
12141
|
+
});
|
|
12142
|
+
});
|
|
12143
|
+
if (itemCount > 100) {
|
|
12144
|
+
context.addIssue({
|
|
12145
|
+
code: "custom",
|
|
12146
|
+
message: "Current-user menu supports at most 100 items.",
|
|
12147
|
+
path: ["sections"]
|
|
12148
|
+
});
|
|
12149
|
+
}
|
|
12150
|
+
});
|
|
12151
|
+
var LegacyCurrentUserMenuProfileSchema = z10.array(z10.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
|
|
12152
|
+
const seen = /* @__PURE__ */ new Set();
|
|
12153
|
+
value.forEach((item, index) => {
|
|
12154
|
+
if (seen.has(item)) {
|
|
12155
|
+
context.addIssue({
|
|
12156
|
+
code: "custom",
|
|
12157
|
+
message: `Duplicate legacy current-user menu item ${item}.`,
|
|
12158
|
+
path: [index]
|
|
12159
|
+
});
|
|
12160
|
+
}
|
|
12161
|
+
seen.add(item);
|
|
12162
|
+
});
|
|
12163
|
+
});
|
|
12164
|
+
var CurrentUserMenuProfileSchema = z10.union([
|
|
12165
|
+
z10.literal("*"),
|
|
12166
|
+
LegacyCurrentUserMenuProfileSchema,
|
|
12167
|
+
CurrentUserMenuConfigSchema
|
|
12168
|
+
]);
|
|
12080
12169
|
var ThemeHeadbarSchema = z10.object({
|
|
12081
12170
|
theme: z10.enum(["card", "glassy", "ghost"]).optional(),
|
|
12082
12171
|
navPosition: z10.enum(["left", "center", "right"]).optional(),
|
|
12083
12172
|
actions: z10.union([z10.literal("*"), z10.array(ContractIdentifierSchema)]).optional(),
|
|
12084
|
-
profile:
|
|
12173
|
+
profile: CurrentUserMenuProfileSchema.optional(),
|
|
12085
12174
|
showTeamQuota: z10.boolean().optional()
|
|
12086
12175
|
}).strict();
|
|
12087
12176
|
var TenantHeadbarModuleLeafSchema = z10.object({
|