@inf-monkeys-tech/monkeys 1.0.34 → 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 +337 -4
- package/lib/contracts/tenant.d.ts.map +1 -1
- package/lib/contracts/tenant.js +125 -2
- package/lib/contracts/tenant.js.map +1 -1
- package/lib/esm/contracts/index.mjs +112 -1
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +112 -1
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +99 -1
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +107 -1
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/tenant-product-config.schema.json +194 -2
- package/lib/json-schema/tenant-runtime-config.schema.json +194 -2
- package/lib/schemas/index.d.ts +91 -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/test/fixtures/tenant-product-config.public.json +10 -0
|
@@ -12065,15 +12065,112 @@ var TenantDataBindingsSchema = z10.record(
|
|
|
12065
12065
|
ContractIdentifierSchema,
|
|
12066
12066
|
TenantDataBindingSchema
|
|
12067
12067
|
);
|
|
12068
|
+
var TenantTrendRadarSourceSchema = z10.object({
|
|
12069
|
+
ontologyId: ContractIdentifierSchema,
|
|
12070
|
+
viewId: ContractIdentifierSchema
|
|
12071
|
+
}).strict();
|
|
12072
|
+
var TenantTrendRadarSourcesSchema = z10.object({
|
|
12073
|
+
hotwords: TenantTrendRadarSourceSchema.optional(),
|
|
12074
|
+
brands: TenantTrendRadarSourceSchema.optional()
|
|
12075
|
+
}).strict();
|
|
12068
12076
|
var AssetVariantsSchema = z10.object({
|
|
12069
12077
|
light: z10.string().optional(),
|
|
12070
12078
|
dark: z10.string().optional()
|
|
12071
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
|
+
]);
|
|
12072
12169
|
var ThemeHeadbarSchema = z10.object({
|
|
12073
12170
|
theme: z10.enum(["card", "glassy", "ghost"]).optional(),
|
|
12074
12171
|
navPosition: z10.enum(["left", "center", "right"]).optional(),
|
|
12075
12172
|
actions: z10.union([z10.literal("*"), z10.array(ContractIdentifierSchema)]).optional(),
|
|
12076
|
-
profile:
|
|
12173
|
+
profile: CurrentUserMenuProfileSchema.optional(),
|
|
12077
12174
|
showTeamQuota: z10.boolean().optional()
|
|
12078
12175
|
}).strict();
|
|
12079
12176
|
var TenantHeadbarModuleLeafSchema = z10.object({
|
|
@@ -12445,6 +12542,7 @@ var TenantApplicationConfigSchema = z10.object({
|
|
|
12445
12542
|
tep: z10.object({ baseUrl: z10.string().optional(), timeoutMs: z10.number().int().positive().optional() }).strict().optional(),
|
|
12446
12543
|
runtime: z10.object({ appId: ContractIdentifierSchema, tepBaseUrlConfigured: z10.boolean(), tepAuthorizationConfigured: z10.boolean(), tepCookieConfigured: z10.boolean() }).strict().optional()
|
|
12447
12544
|
}).strict().optional(),
|
|
12545
|
+
trendRadar: TenantTrendRadarSourcesSchema.optional(),
|
|
12448
12546
|
sharing: z10.object({
|
|
12449
12547
|
silentViewLinks: z10.object({ enabled: z10.boolean().optional(), placement: z10.object({ mode: z10.enum(["sourceOntology", "ontology"]).optional(), ontologyId: ContractIdentifierSchema.optional(), parentId: ContractIdentifierSchema.optional(), navId: ContractIdentifierSchema.optional() }).strict().optional() }).strict().optional(),
|
|
12450
12548
|
shareAccess: z10.object({ publicLinksEnabled: z10.boolean().optional(), passwordGateEnabled: z10.boolean().optional(), passwordAccessTtlSeconds: z10.number().int().positive().optional(), defaultViewTreeDelivery: z10.enum(["manual", "auto"]).optional() }).strict().optional(),
|