@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
|
@@ -10937,11 +10937,100 @@ var AssetVariantsSchema = z12.object({
|
|
|
10937
10937
|
light: z12.string().optional(),
|
|
10938
10938
|
dark: z12.string().optional()
|
|
10939
10939
|
}).strict();
|
|
10940
|
+
var LEGACY_CURRENT_USER_MENU_ITEM_IDS = ["dark-mode", "language", "settings", "logout"];
|
|
10941
|
+
var CURRENT_USER_MENU_CONTROL_REFS = ["dark-mode", "language"];
|
|
10942
|
+
var CURRENT_USER_MENU_ACTION_REFS = ["logout"];
|
|
10943
|
+
var CurrentUserMenuIdentifierSchema = z12.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
|
|
10944
|
+
var CurrentUserMenuDisplayTextSchema = z12.union([
|
|
10945
|
+
z12.string().trim().min(1),
|
|
10946
|
+
z12.record(z12.string().trim().min(1), z12.string().trim().min(1)).refine((value) => Object.keys(value).length > 0, "Localized menu text must contain at least one locale.")
|
|
10947
|
+
]);
|
|
10948
|
+
var CurrentUserMenuNavigationItemSchema = z12.object({
|
|
10949
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
10950
|
+
kind: z12.literal("navigation"),
|
|
10951
|
+
ref: CurrentUserMenuIdentifierSchema
|
|
10952
|
+
}).strict();
|
|
10953
|
+
var CurrentUserMenuControlItemSchema = z12.object({
|
|
10954
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
10955
|
+
kind: z12.literal("control"),
|
|
10956
|
+
ref: z12.enum(CURRENT_USER_MENU_CONTROL_REFS)
|
|
10957
|
+
}).strict();
|
|
10958
|
+
var CurrentUserMenuActionItemSchema = z12.object({
|
|
10959
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
10960
|
+
kind: z12.literal("action"),
|
|
10961
|
+
ref: z12.enum(CURRENT_USER_MENU_ACTION_REFS),
|
|
10962
|
+
tone: z12.enum(["default", "danger"]).optional()
|
|
10963
|
+
}).strict();
|
|
10964
|
+
var CurrentUserMenuItemSchema = z12.discriminatedUnion("kind", [
|
|
10965
|
+
CurrentUserMenuNavigationItemSchema,
|
|
10966
|
+
CurrentUserMenuControlItemSchema,
|
|
10967
|
+
CurrentUserMenuActionItemSchema
|
|
10968
|
+
]);
|
|
10969
|
+
var CurrentUserMenuSectionSchema = z12.object({
|
|
10970
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
10971
|
+
label: CurrentUserMenuDisplayTextSchema.optional(),
|
|
10972
|
+
dividerBefore: z12.boolean().optional(),
|
|
10973
|
+
items: z12.array(CurrentUserMenuItemSchema)
|
|
10974
|
+
}).strict();
|
|
10975
|
+
var CurrentUserMenuConfigSchema = z12.object({
|
|
10976
|
+
version: z12.literal(1),
|
|
10977
|
+
sections: z12.array(CurrentUserMenuSectionSchema).max(20)
|
|
10978
|
+
}).strict().superRefine((value, context) => {
|
|
10979
|
+
const sectionIds = /* @__PURE__ */ new Set();
|
|
10980
|
+
const itemIds = /* @__PURE__ */ new Set();
|
|
10981
|
+
let itemCount = 0;
|
|
10982
|
+
value.sections.forEach((section, sectionIndex) => {
|
|
10983
|
+
if (sectionIds.has(section.id)) {
|
|
10984
|
+
context.addIssue({
|
|
10985
|
+
code: "custom",
|
|
10986
|
+
message: `Duplicate current-user menu section id ${section.id}.`,
|
|
10987
|
+
path: ["sections", sectionIndex, "id"]
|
|
10988
|
+
});
|
|
10989
|
+
}
|
|
10990
|
+
sectionIds.add(section.id);
|
|
10991
|
+
itemCount += section.items.length;
|
|
10992
|
+
section.items.forEach((item, itemIndex) => {
|
|
10993
|
+
if (itemIds.has(item.id)) {
|
|
10994
|
+
context.addIssue({
|
|
10995
|
+
code: "custom",
|
|
10996
|
+
message: `Duplicate current-user menu item id ${item.id}.`,
|
|
10997
|
+
path: ["sections", sectionIndex, "items", itemIndex, "id"]
|
|
10998
|
+
});
|
|
10999
|
+
}
|
|
11000
|
+
itemIds.add(item.id);
|
|
11001
|
+
});
|
|
11002
|
+
});
|
|
11003
|
+
if (itemCount > 100) {
|
|
11004
|
+
context.addIssue({
|
|
11005
|
+
code: "custom",
|
|
11006
|
+
message: "Current-user menu supports at most 100 items.",
|
|
11007
|
+
path: ["sections"]
|
|
11008
|
+
});
|
|
11009
|
+
}
|
|
11010
|
+
});
|
|
11011
|
+
var LegacyCurrentUserMenuProfileSchema = z12.array(z12.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
|
|
11012
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11013
|
+
value.forEach((item, index) => {
|
|
11014
|
+
if (seen.has(item)) {
|
|
11015
|
+
context.addIssue({
|
|
11016
|
+
code: "custom",
|
|
11017
|
+
message: `Duplicate legacy current-user menu item ${item}.`,
|
|
11018
|
+
path: [index]
|
|
11019
|
+
});
|
|
11020
|
+
}
|
|
11021
|
+
seen.add(item);
|
|
11022
|
+
});
|
|
11023
|
+
});
|
|
11024
|
+
var CurrentUserMenuProfileSchema = z12.union([
|
|
11025
|
+
z12.literal("*"),
|
|
11026
|
+
LegacyCurrentUserMenuProfileSchema,
|
|
11027
|
+
CurrentUserMenuConfigSchema
|
|
11028
|
+
]);
|
|
10940
11029
|
var ThemeHeadbarSchema = z12.object({
|
|
10941
11030
|
theme: z12.enum(["card", "glassy", "ghost"]).optional(),
|
|
10942
11031
|
navPosition: z12.enum(["left", "center", "right"]).optional(),
|
|
10943
11032
|
actions: z12.union([z12.literal("*"), z12.array(ContractIdentifierSchema)]).optional(),
|
|
10944
|
-
profile:
|
|
11033
|
+
profile: CurrentUserMenuProfileSchema.optional(),
|
|
10945
11034
|
showTeamQuota: z12.boolean().optional()
|
|
10946
11035
|
}).strict();
|
|
10947
11036
|
var TenantHeadbarModuleLeafSchema = z12.object({
|
|
@@ -12284,6 +12373,8 @@ export {
|
|
|
12284
12373
|
BodyRelationRecordSchema,
|
|
12285
12374
|
BrandBodySchema,
|
|
12286
12375
|
BrandGeneticsProfileSchema,
|
|
12376
|
+
CURRENT_USER_MENU_ACTION_REFS,
|
|
12377
|
+
CURRENT_USER_MENU_CONTROL_REFS,
|
|
12287
12378
|
CapabilityManifestSchema,
|
|
12288
12379
|
CapabilityProviderBindingSchema,
|
|
12289
12380
|
CapabilityRegistryDocumentSchema,
|
|
@@ -12303,6 +12394,14 @@ export {
|
|
|
12303
12394
|
ContractMetadataSchema,
|
|
12304
12395
|
ContractPortSchema,
|
|
12305
12396
|
ContractVersionSchema,
|
|
12397
|
+
CurrentUserMenuActionItemSchema,
|
|
12398
|
+
CurrentUserMenuConfigSchema,
|
|
12399
|
+
CurrentUserMenuControlItemSchema,
|
|
12400
|
+
CurrentUserMenuDisplayTextSchema,
|
|
12401
|
+
CurrentUserMenuItemSchema,
|
|
12402
|
+
CurrentUserMenuNavigationItemSchema,
|
|
12403
|
+
CurrentUserMenuProfileSchema,
|
|
12404
|
+
CurrentUserMenuSectionSchema,
|
|
12306
12405
|
DataContinuityEnvelopeSchema,
|
|
12307
12406
|
DeclarationGraphEdgeSchema,
|
|
12308
12407
|
DesignTokenSourceSchema,
|
|
@@ -12316,6 +12415,7 @@ export {
|
|
|
12316
12415
|
IsoDateTimeSchema,
|
|
12317
12416
|
JsonObjectSchema,
|
|
12318
12417
|
JsonValueSchema,
|
|
12418
|
+
LEGACY_CURRENT_USER_MENU_ITEM_IDS,
|
|
12319
12419
|
LineageRecordSchema,
|
|
12320
12420
|
LocaleIdentifierSchema,
|
|
12321
12421
|
LocalizedTextSchema,
|