@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
package/lib/esm/index.mjs
CHANGED
|
@@ -11007,11 +11007,100 @@ var AssetVariantsSchema = z12.object({
|
|
|
11007
11007
|
light: z12.string().optional(),
|
|
11008
11008
|
dark: z12.string().optional()
|
|
11009
11009
|
}).strict();
|
|
11010
|
+
var LEGACY_CURRENT_USER_MENU_ITEM_IDS = ["dark-mode", "language", "settings", "logout"];
|
|
11011
|
+
var CURRENT_USER_MENU_CONTROL_REFS = ["dark-mode", "language"];
|
|
11012
|
+
var CURRENT_USER_MENU_ACTION_REFS = ["logout"];
|
|
11013
|
+
var CurrentUserMenuIdentifierSchema = z12.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
|
|
11014
|
+
var CurrentUserMenuDisplayTextSchema = z12.union([
|
|
11015
|
+
z12.string().trim().min(1),
|
|
11016
|
+
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.")
|
|
11017
|
+
]);
|
|
11018
|
+
var CurrentUserMenuNavigationItemSchema = z12.object({
|
|
11019
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
11020
|
+
kind: z12.literal("navigation"),
|
|
11021
|
+
ref: CurrentUserMenuIdentifierSchema
|
|
11022
|
+
}).strict();
|
|
11023
|
+
var CurrentUserMenuControlItemSchema = z12.object({
|
|
11024
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
11025
|
+
kind: z12.literal("control"),
|
|
11026
|
+
ref: z12.enum(CURRENT_USER_MENU_CONTROL_REFS)
|
|
11027
|
+
}).strict();
|
|
11028
|
+
var CurrentUserMenuActionItemSchema = z12.object({
|
|
11029
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
11030
|
+
kind: z12.literal("action"),
|
|
11031
|
+
ref: z12.enum(CURRENT_USER_MENU_ACTION_REFS),
|
|
11032
|
+
tone: z12.enum(["default", "danger"]).optional()
|
|
11033
|
+
}).strict();
|
|
11034
|
+
var CurrentUserMenuItemSchema = z12.discriminatedUnion("kind", [
|
|
11035
|
+
CurrentUserMenuNavigationItemSchema,
|
|
11036
|
+
CurrentUserMenuControlItemSchema,
|
|
11037
|
+
CurrentUserMenuActionItemSchema
|
|
11038
|
+
]);
|
|
11039
|
+
var CurrentUserMenuSectionSchema = z12.object({
|
|
11040
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
11041
|
+
label: CurrentUserMenuDisplayTextSchema.optional(),
|
|
11042
|
+
dividerBefore: z12.boolean().optional(),
|
|
11043
|
+
items: z12.array(CurrentUserMenuItemSchema)
|
|
11044
|
+
}).strict();
|
|
11045
|
+
var CurrentUserMenuConfigSchema = z12.object({
|
|
11046
|
+
version: z12.literal(1),
|
|
11047
|
+
sections: z12.array(CurrentUserMenuSectionSchema).max(20)
|
|
11048
|
+
}).strict().superRefine((value, context) => {
|
|
11049
|
+
const sectionIds = /* @__PURE__ */ new Set();
|
|
11050
|
+
const itemIds = /* @__PURE__ */ new Set();
|
|
11051
|
+
let itemCount = 0;
|
|
11052
|
+
value.sections.forEach((section, sectionIndex) => {
|
|
11053
|
+
if (sectionIds.has(section.id)) {
|
|
11054
|
+
context.addIssue({
|
|
11055
|
+
code: "custom",
|
|
11056
|
+
message: `Duplicate current-user menu section id ${section.id}.`,
|
|
11057
|
+
path: ["sections", sectionIndex, "id"]
|
|
11058
|
+
});
|
|
11059
|
+
}
|
|
11060
|
+
sectionIds.add(section.id);
|
|
11061
|
+
itemCount += section.items.length;
|
|
11062
|
+
section.items.forEach((item, itemIndex) => {
|
|
11063
|
+
if (itemIds.has(item.id)) {
|
|
11064
|
+
context.addIssue({
|
|
11065
|
+
code: "custom",
|
|
11066
|
+
message: `Duplicate current-user menu item id ${item.id}.`,
|
|
11067
|
+
path: ["sections", sectionIndex, "items", itemIndex, "id"]
|
|
11068
|
+
});
|
|
11069
|
+
}
|
|
11070
|
+
itemIds.add(item.id);
|
|
11071
|
+
});
|
|
11072
|
+
});
|
|
11073
|
+
if (itemCount > 100) {
|
|
11074
|
+
context.addIssue({
|
|
11075
|
+
code: "custom",
|
|
11076
|
+
message: "Current-user menu supports at most 100 items.",
|
|
11077
|
+
path: ["sections"]
|
|
11078
|
+
});
|
|
11079
|
+
}
|
|
11080
|
+
});
|
|
11081
|
+
var LegacyCurrentUserMenuProfileSchema = z12.array(z12.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
|
|
11082
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11083
|
+
value.forEach((item, index) => {
|
|
11084
|
+
if (seen.has(item)) {
|
|
11085
|
+
context.addIssue({
|
|
11086
|
+
code: "custom",
|
|
11087
|
+
message: `Duplicate legacy current-user menu item ${item}.`,
|
|
11088
|
+
path: [index]
|
|
11089
|
+
});
|
|
11090
|
+
}
|
|
11091
|
+
seen.add(item);
|
|
11092
|
+
});
|
|
11093
|
+
});
|
|
11094
|
+
var CurrentUserMenuProfileSchema = z12.union([
|
|
11095
|
+
z12.literal("*"),
|
|
11096
|
+
LegacyCurrentUserMenuProfileSchema,
|
|
11097
|
+
CurrentUserMenuConfigSchema
|
|
11098
|
+
]);
|
|
11010
11099
|
var ThemeHeadbarSchema = z12.object({
|
|
11011
11100
|
theme: z12.enum(["card", "glassy", "ghost"]).optional(),
|
|
11012
11101
|
navPosition: z12.enum(["left", "center", "right"]).optional(),
|
|
11013
11102
|
actions: z12.union([z12.literal("*"), z12.array(ContractIdentifierSchema)]).optional(),
|
|
11014
|
-
profile:
|
|
11103
|
+
profile: CurrentUserMenuProfileSchema.optional(),
|
|
11015
11104
|
showTeamQuota: z12.boolean().optional()
|
|
11016
11105
|
}).strict();
|
|
11017
11106
|
var TenantHeadbarModuleLeafSchema = z12.object({
|
|
@@ -13656,6 +13745,8 @@ export {
|
|
|
13656
13745
|
BrandBodySchema,
|
|
13657
13746
|
BrandGeneticsProfileSchema,
|
|
13658
13747
|
CODE_LANGUAGES,
|
|
13748
|
+
CURRENT_USER_MENU_ACTION_REFS,
|
|
13749
|
+
CURRENT_USER_MENU_CONTROL_REFS,
|
|
13659
13750
|
CapabilityManifestSchema,
|
|
13660
13751
|
CapabilityProviderBindingSchema,
|
|
13661
13752
|
CapabilityRegistryDocumentSchema,
|
|
@@ -13675,6 +13766,14 @@ export {
|
|
|
13675
13766
|
ContractMetadataSchema,
|
|
13676
13767
|
ContractPortSchema,
|
|
13677
13768
|
ContractVersionSchema,
|
|
13769
|
+
CurrentUserMenuActionItemSchema,
|
|
13770
|
+
CurrentUserMenuConfigSchema,
|
|
13771
|
+
CurrentUserMenuControlItemSchema,
|
|
13772
|
+
CurrentUserMenuDisplayTextSchema,
|
|
13773
|
+
CurrentUserMenuItemSchema,
|
|
13774
|
+
CurrentUserMenuNavigationItemSchema,
|
|
13775
|
+
CurrentUserMenuProfileSchema,
|
|
13776
|
+
CurrentUserMenuSectionSchema,
|
|
13678
13777
|
DEFAULT_CONDUCTOR_OWNER_EMAIL,
|
|
13679
13778
|
DataContinuityEnvelopeSchema,
|
|
13680
13779
|
DeclarationGraphEdgeSchema,
|
|
@@ -13689,6 +13788,7 @@ export {
|
|
|
13689
13788
|
IsoDateTimeSchema,
|
|
13690
13789
|
JsonObjectSchema,
|
|
13691
13790
|
JsonValueSchema,
|
|
13791
|
+
LEGACY_CURRENT_USER_MENU_ITEM_IDS,
|
|
13692
13792
|
LineageRecordSchema,
|
|
13693
13793
|
LocaleIdentifierSchema,
|
|
13694
13794
|
LocalizedTextSchema,
|