@inf-monkeys-tech/monkeys 1.0.46 → 1.0.48
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/access.d.ts +60 -0
- package/lib/contracts/access.d.ts.map +1 -0
- package/lib/contracts/access.js +47 -0
- package/lib/contracts/access.js.map +1 -0
- package/lib/contracts/index.d.ts +1 -0
- package/lib/contracts/index.d.ts.map +1 -1
- package/lib/contracts/index.js +1 -0
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/menu.d.ts +1 -1
- package/lib/contracts/page.d.ts +3 -3
- package/lib/contracts/render.d.ts +4 -4
- package/lib/contracts/semantic.d.ts +1 -1
- package/lib/contracts/tenant.d.ts +161 -5
- package/lib/contracts/tenant.d.ts.map +1 -1
- package/lib/contracts/tenant.js +39 -1
- package/lib/contracts/tenant.js.map +1 -1
- package/lib/esm/contracts/index.mjs +1468 -1399
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +1526 -1401
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +122 -2
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +1468 -1399
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/json-schema/tenant-product-config.schema.json +104 -0
- package/lib/json-schema/tenant-runtime-config.schema.json +104 -0
- package/lib/runtime/access-compiler.d.ts +10 -0
- package/lib/runtime/access-compiler.d.ts.map +1 -0
- package/lib/runtime/access-compiler.js +63 -0
- package/lib/runtime/access-compiler.js.map +1 -0
- package/lib/runtime/index.d.ts +1 -0
- package/lib/runtime/index.d.ts.map +1 -1
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/menu-compiler.d.ts +0 -1
- package/lib/runtime/menu-compiler.d.ts.map +1 -1
- package/lib/runtime/menu-compiler.js +1 -2
- package/lib/runtime/menu-compiler.js.map +1 -1
- package/lib/schemas/index.d.ts +100 -9
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +11 -5
- package/lib/schemas/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -9836,14 +9836,13 @@ var evaluateAccess = (item, context) => {
|
|
|
9836
9836
|
if (!context.sessionResolved && protectedBySession) reasons.push("session-unresolved");
|
|
9837
9837
|
if (item.access.authenticated && !context.authenticated) reasons.push("authentication");
|
|
9838
9838
|
const granted = new Set(context.permissionCodes);
|
|
9839
|
-
const elevated = context.isKernelSuperAdmin === true || granted.has("*");
|
|
9840
9839
|
if (item.access.permissionAllOf.some((permission) => !granted.has(permission))) {
|
|
9841
9840
|
reasons.push("permission-all");
|
|
9842
9841
|
}
|
|
9843
9842
|
if (item.access.permissionAnyOf.length > 0 && !item.access.permissionAnyOf.some((permission) => granted.has(permission))) {
|
|
9844
9843
|
reasons.push("permission-any");
|
|
9845
9844
|
}
|
|
9846
|
-
if (
|
|
9845
|
+
if (item.access.requiredPermission && !granted.has(item.access.requiredPermission)) {
|
|
9847
9846
|
reasons.push("required-permission");
|
|
9848
9847
|
}
|
|
9849
9848
|
if (item.access.featureFlags.some((flag) => context.featureFlags[flag] !== true)) {
|
|
@@ -13239,6 +13238,27 @@ var TenantLandingPageConfigSchema = z11.discriminatedUnion("mode", [
|
|
|
13239
13238
|
LandingPageHtmlConfigSchema,
|
|
13240
13239
|
LandingPageIframeConfigSchema
|
|
13241
13240
|
]);
|
|
13241
|
+
var ListFooterPageSizeOptionsSchema = z11.array(z11.number().int().positive().max(1e3)).min(1).max(10).superRefine((options, context) => {
|
|
13242
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13243
|
+
options.forEach((option, index) => {
|
|
13244
|
+
if (seen.has(option)) {
|
|
13245
|
+
context.addIssue({
|
|
13246
|
+
code: "custom",
|
|
13247
|
+
message: `Duplicate list footer page size option ${option}.`,
|
|
13248
|
+
path: [index]
|
|
13249
|
+
});
|
|
13250
|
+
}
|
|
13251
|
+
seen.add(option);
|
|
13252
|
+
});
|
|
13253
|
+
});
|
|
13254
|
+
var TenantListFooterConfigSchema = z11.object({
|
|
13255
|
+
showTotal: z11.boolean().optional(),
|
|
13256
|
+
showPageSize: z11.boolean().optional(),
|
|
13257
|
+
pageSizeOptions: ListFooterPageSizeOptionsSchema.optional(),
|
|
13258
|
+
paginationMode: z11.enum(["auto", "pages", "compact"]).optional(),
|
|
13259
|
+
alignment: z11.enum(["start", "end", "space-between"]).optional(),
|
|
13260
|
+
density: z11.enum(["compact", "default", "comfortable"]).optional()
|
|
13261
|
+
}).strict();
|
|
13242
13262
|
var TenantApplicationConfigSchema = z11.object({
|
|
13243
13263
|
theme: z11.object({
|
|
13244
13264
|
id: z11.string().optional(),
|
|
@@ -13288,6 +13308,7 @@ var TenantApplicationConfigSchema = z11.object({
|
|
|
13288
13308
|
headbar: KernelHeadbarSchema.optional()
|
|
13289
13309
|
}).strict().optional(),
|
|
13290
13310
|
paginationPosition: z11.enum(["left", "right"]).optional(),
|
|
13311
|
+
listFooter: TenantListFooterConfigSchema.optional(),
|
|
13291
13312
|
ugcViewIconOnlyMode: z11.boolean().optional(),
|
|
13292
13313
|
workflowPreviewExecutionGrid: z11.object({
|
|
13293
13314
|
selectionModeDisplayType: z11.enum(["operation-button", "dropdown-menu"]).optional(),
|
|
@@ -13309,6 +13330,13 @@ var TenantApplicationConfigSchema = z11.object({
|
|
|
13309
13330
|
teamAsUser: z11.boolean().optional(),
|
|
13310
13331
|
themeMode: z11.enum(["shadow", "border"]).optional(),
|
|
13311
13332
|
density: z11.enum(["compact", "default", "comfortable"]).optional(),
|
|
13333
|
+
statusStates: z11.object({
|
|
13334
|
+
loading: z11.object({ variant: z11.enum(["spinner", "skeleton"]).optional() }).strict().optional(),
|
|
13335
|
+
empty: z11.object({ variant: z11.enum(["default", "compact"]).optional() }).strict().optional(),
|
|
13336
|
+
error: z11.object({ showRetry: z11.boolean().optional() }).strict().optional(),
|
|
13337
|
+
permission: z11.object({ showRequestAccess: z11.boolean().optional() }).strict().optional(),
|
|
13338
|
+
density: z11.enum(["compact", "default", "comfortable"]).optional()
|
|
13339
|
+
}).strict().optional(),
|
|
13312
13340
|
pageZoom: z11.number().positive().optional(),
|
|
13313
13341
|
miniMode: z11.object({ showPreviewViewExecutionResultGrid: z11.boolean() }).strict().optional(),
|
|
13314
13342
|
workflow: z11.object({ allowConcurrentRuns: z11.boolean() }).strict().optional(),
|
|
@@ -13747,6 +13775,97 @@ var compileWorkflowPersistenceProjection = (input) => {
|
|
|
13747
13775
|
output: Object.freeze(workflow.parameters.outputs)
|
|
13748
13776
|
});
|
|
13749
13777
|
};
|
|
13778
|
+
|
|
13779
|
+
// src/contracts/access.ts
|
|
13780
|
+
import { z as z12 } from "zod";
|
|
13781
|
+
var PermissionDefinitionSchema = z12.object({
|
|
13782
|
+
code: ContractIdentifierSchema,
|
|
13783
|
+
name: LocalizedTextSchema,
|
|
13784
|
+
description: LocalizedTextSchema.optional(),
|
|
13785
|
+
resource: ContractIdentifierSchema,
|
|
13786
|
+
action: ContractIdentifierSchema,
|
|
13787
|
+
domain: ContractIdentifierSchema.optional()
|
|
13788
|
+
}).strict();
|
|
13789
|
+
var PermissionBundleSchema = z12.object({
|
|
13790
|
+
bundleId: ContractIdentifierSchema,
|
|
13791
|
+
name: LocalizedTextSchema,
|
|
13792
|
+
permissionCodes: z12.array(ContractIdentifierSchema).default([])
|
|
13793
|
+
}).strict();
|
|
13794
|
+
var SystemGroupDefinitionSchema = z12.object({
|
|
13795
|
+
groupCode: ContractIdentifierSchema,
|
|
13796
|
+
name: LocalizedTextSchema,
|
|
13797
|
+
description: LocalizedTextSchema.optional(),
|
|
13798
|
+
permissionPolicy: z12.enum(["bundles", "studio_current", "all_current"]).default("bundles"),
|
|
13799
|
+
permissionBundleIds: z12.array(ContractIdentifierSchema).default([])
|
|
13800
|
+
}).strict().refine((value) => value.permissionPolicy !== "bundles" || value.permissionBundleIds.length > 0, {
|
|
13801
|
+
message: "A bundles permission policy requires at least one permission bundle.",
|
|
13802
|
+
path: ["permissionBundleIds"]
|
|
13803
|
+
});
|
|
13804
|
+
var ProductAccessDeclarationSchema = z12.object({
|
|
13805
|
+
contract: z12.literal("ProductAccessDeclaration"),
|
|
13806
|
+
declarationId: ContractIdentifierSchema,
|
|
13807
|
+
version: ContractVersionSchema,
|
|
13808
|
+
ownerRepo: ContractIdentifierSchema,
|
|
13809
|
+
permissions: z12.array(PermissionDefinitionSchema).default([]),
|
|
13810
|
+
permissionBundles: z12.array(PermissionBundleSchema).default([]),
|
|
13811
|
+
systemGroups: z12.array(SystemGroupDefinitionSchema).min(1)
|
|
13812
|
+
}).strict();
|
|
13813
|
+
|
|
13814
|
+
// src/runtime/access-compiler.ts
|
|
13815
|
+
var uniqueBy = (values, key, label) => {
|
|
13816
|
+
const result = /* @__PURE__ */ new Map();
|
|
13817
|
+
for (const value of values) {
|
|
13818
|
+
const id = key(value);
|
|
13819
|
+
if (result.has(id)) throw new Error(`Duplicate ${label} ${id}.`);
|
|
13820
|
+
result.set(id, value);
|
|
13821
|
+
}
|
|
13822
|
+
return result;
|
|
13823
|
+
};
|
|
13824
|
+
var compileProductAccessDeclaration = (input) => {
|
|
13825
|
+
const declaration = ProductAccessDeclarationSchema.parse(input);
|
|
13826
|
+
const permissionsByCode = uniqueBy(declaration.permissions, (item) => item.code, "permission");
|
|
13827
|
+
const bundlesById = uniqueBy(declaration.permissionBundles, (item) => item.bundleId, "permission bundle");
|
|
13828
|
+
uniqueBy(declaration.systemGroups, (item) => item.groupCode, "system group");
|
|
13829
|
+
const permissionCodesByBundle = /* @__PURE__ */ new Map();
|
|
13830
|
+
for (const bundle of declaration.permissionBundles) {
|
|
13831
|
+
for (const permissionCode of bundle.permissionCodes) {
|
|
13832
|
+
if (!permissionsByCode.has(permissionCode)) {
|
|
13833
|
+
throw new Error(`Permission bundle ${bundle.bundleId} references unknown permission ${permissionCode}.`);
|
|
13834
|
+
}
|
|
13835
|
+
}
|
|
13836
|
+
permissionCodesByBundle.set(bundle.bundleId, [...new Set(bundle.permissionCodes)]);
|
|
13837
|
+
}
|
|
13838
|
+
const permissionCodesBySystemGroup = /* @__PURE__ */ new Map();
|
|
13839
|
+
const permissionPolicyBySystemGroup = /* @__PURE__ */ new Map();
|
|
13840
|
+
for (const group of declaration.systemGroups) {
|
|
13841
|
+
const permissionCodes = /* @__PURE__ */ new Set();
|
|
13842
|
+
permissionPolicyBySystemGroup.set(group.groupCode, group.permissionPolicy);
|
|
13843
|
+
if (group.permissionPolicy === "all_current") {
|
|
13844
|
+
for (const permission of declaration.permissions) permissionCodes.add(permission.code);
|
|
13845
|
+
}
|
|
13846
|
+
if (group.permissionPolicy === "studio_current") {
|
|
13847
|
+
for (const permission of declaration.permissions) {
|
|
13848
|
+
if (permission.domain === "studio" || permission.code.startsWith("studio:")) permissionCodes.add(permission.code);
|
|
13849
|
+
}
|
|
13850
|
+
}
|
|
13851
|
+
for (const bundleId of group.permissionBundleIds) {
|
|
13852
|
+
if (!bundlesById.has(bundleId)) {
|
|
13853
|
+
throw new Error(`System group ${group.groupCode} references unknown permission bundle ${bundleId}.`);
|
|
13854
|
+
}
|
|
13855
|
+
for (const permissionCode of permissionCodesByBundle.get(bundleId) ?? []) {
|
|
13856
|
+
permissionCodes.add(permissionCode);
|
|
13857
|
+
}
|
|
13858
|
+
}
|
|
13859
|
+
permissionCodesBySystemGroup.set(group.groupCode, [...permissionCodes]);
|
|
13860
|
+
}
|
|
13861
|
+
return {
|
|
13862
|
+
declaration,
|
|
13863
|
+
permissionsByCode,
|
|
13864
|
+
permissionCodesByBundle,
|
|
13865
|
+
permissionCodesBySystemGroup,
|
|
13866
|
+
permissionPolicyBySystemGroup
|
|
13867
|
+
};
|
|
13868
|
+
};
|
|
13750
13869
|
export {
|
|
13751
13870
|
APPLICATION_HANDOFF_QUERY_PARAMETER,
|
|
13752
13871
|
DEFAULT_CONDUCTOR_OWNER_EMAIL,
|
|
@@ -13762,6 +13881,7 @@ export {
|
|
|
13762
13881
|
compileConductorWorkflowDefinition,
|
|
13763
13882
|
compileMenuRuntimeBundle,
|
|
13764
13883
|
compilePageRuntimeProjection,
|
|
13884
|
+
compileProductAccessDeclaration,
|
|
13765
13885
|
compileProductDeclaration,
|
|
13766
13886
|
compileProductRuntimeCatalog,
|
|
13767
13887
|
compileRenderTree,
|