@inf-monkeys-tech/monkeys 1.0.35 → 1.0.37
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/common.d.ts +2 -1
- package/lib/contracts/common.d.ts.map +1 -1
- package/lib/contracts/common.js.map +1 -1
- 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 +790 -0
- package/lib/contracts/menu.d.ts.map +1 -0
- package/lib/contracts/menu.js +319 -0
- package/lib/contracts/menu.js.map +1 -0
- package/lib/contracts/page.d.ts +6 -0
- package/lib/contracts/page.d.ts.map +1 -1
- package/lib/contracts/page.js +6 -0
- package/lib/contracts/page.js.map +1 -1
- package/lib/contracts/semantic.d.ts +59 -0
- package/lib/contracts/semantic.d.ts.map +1 -1
- package/lib/contracts/semantic.js +2 -0
- package/lib/contracts/semantic.js.map +1 -1
- package/lib/contracts/tenant.d.ts +445 -4
- package/lib/contracts/tenant.d.ts.map +1 -1
- package/lib/contracts/tenant.js +113 -2
- package/lib/contracts/tenant.js.map +1 -1
- package/lib/esm/contracts/index.mjs +1166 -746
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +1692 -749
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +1234 -342
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +1158 -746
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/index.json +3 -0
- package/lib/json-schema/menu-definition-set.schema.json +411 -0
- package/lib/json-schema/menu-definition.schema.json +385 -0
- package/lib/json-schema/menu-runtime-bundle.schema.json +541 -0
- package/lib/json-schema/page-definition.schema.json +14 -0
- package/lib/json-schema/page-runtime-descriptor.schema.json +14 -0
- package/lib/json-schema/product-declaration.schema.json +369 -1
- package/lib/json-schema/tenant-product-config.schema.json +537 -2
- package/lib/json-schema/tenant-runtime-config.schema.json +667 -2
- package/lib/runtime/declaration-compiler.d.ts +2 -0
- package/lib/runtime/declaration-compiler.d.ts.map +1 -1
- package/lib/runtime/declaration-compiler.js +4 -0
- package/lib/runtime/declaration-compiler.js.map +1 -1
- 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 +58 -0
- package/lib/runtime/menu-compiler.d.ts.map +1 -0
- package/lib/runtime/menu-compiler.js +436 -0
- package/lib/runtime/menu-compiler.js.map +1 -0
- package/lib/runtime/tenant-config.d.ts +2 -0
- package/lib/runtime/tenant-config.d.ts.map +1 -1
- package/lib/runtime/tenant-config.js +1 -0
- package/lib/runtime/tenant-config.js.map +1 -1
- package/lib/schemas/index.d.ts +477 -3
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +46 -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/menu-definition.v1.json +41 -0
package/lib/esm/index.mjs
CHANGED
|
@@ -8303,6 +8303,9 @@ var DomainEventSchema = z8.object({
|
|
|
8303
8303
|
occurredAt: IsoDateTimeSchema
|
|
8304
8304
|
}).strict();
|
|
8305
8305
|
|
|
8306
|
+
// src/contracts/menu.ts
|
|
8307
|
+
import { z as z10 } from "zod";
|
|
8308
|
+
|
|
8306
8309
|
// src/contracts/page.ts
|
|
8307
8310
|
import { z as z9 } from "zod";
|
|
8308
8311
|
var PageTypeSchema = z9.enum([
|
|
@@ -8390,6 +8393,9 @@ var PageDefinitionSchema = z9.object({
|
|
|
8390
8393
|
access: z9.object({
|
|
8391
8394
|
actions: z9.array(z9.enum(["read", "write", "execute", "manage-permissions"])).default([])
|
|
8392
8395
|
}).strict(),
|
|
8396
|
+
input: z9.object({
|
|
8397
|
+
schemaRef: ContractIdentifierSchema
|
|
8398
|
+
}).strict().optional(),
|
|
8393
8399
|
rendererConfig: z9.object({
|
|
8394
8400
|
schemaRef: ContractIdentifierSchema,
|
|
8395
8401
|
value: JsonObjectSchema
|
|
@@ -8579,40 +8585,314 @@ var PageRuntimeProjectionSchema = z9.object({
|
|
|
8579
8585
|
}
|
|
8580
8586
|
});
|
|
8581
8587
|
|
|
8588
|
+
// src/contracts/menu.ts
|
|
8589
|
+
var MENU_ACTIVATION_QUERY_PARAMETER = "__menuActivation";
|
|
8590
|
+
var MENU_CONTRACT_VERSION = 1;
|
|
8591
|
+
var MENU_MAX_DEFINITIONS = 128;
|
|
8592
|
+
var MENU_MAX_NODES = 1024;
|
|
8593
|
+
var MENU_MAX_TREE_DEPTH = 16;
|
|
8594
|
+
var MENU_MAX_INPUT_BYTES = 64 * 1024;
|
|
8595
|
+
var MENU_MAX_INPUT_VALUES = 2048;
|
|
8596
|
+
var MenuOrderSchema = z10.number().int().min(-1e6).max(1e6);
|
|
8597
|
+
var inspectJsonValue = (value) => {
|
|
8598
|
+
let maxDepth = 0;
|
|
8599
|
+
let values = 0;
|
|
8600
|
+
const visit = (candidate, depth) => {
|
|
8601
|
+
values += 1;
|
|
8602
|
+
maxDepth = Math.max(maxDepth, depth);
|
|
8603
|
+
if (Array.isArray(candidate)) {
|
|
8604
|
+
candidate.forEach((item) => visit(item, depth + 1));
|
|
8605
|
+
return;
|
|
8606
|
+
}
|
|
8607
|
+
if (candidate && typeof candidate === "object") {
|
|
8608
|
+
Object.values(candidate).forEach((item) => visit(item, depth + 1));
|
|
8609
|
+
}
|
|
8610
|
+
};
|
|
8611
|
+
visit(value, 1);
|
|
8612
|
+
return {
|
|
8613
|
+
bytes: new TextEncoder().encode(JSON.stringify(value)).byteLength,
|
|
8614
|
+
depth: maxDepth,
|
|
8615
|
+
values
|
|
8616
|
+
};
|
|
8617
|
+
};
|
|
8618
|
+
var MenuBoundedInputSchema = JsonObjectSchema.superRefine((value, context) => {
|
|
8619
|
+
const bounds = inspectJsonValue(value);
|
|
8620
|
+
if (bounds.bytes > MENU_MAX_INPUT_BYTES) {
|
|
8621
|
+
context.addIssue({
|
|
8622
|
+
code: "custom",
|
|
8623
|
+
message: `Menu input exceeds ${MENU_MAX_INPUT_BYTES} UTF-8 bytes.`
|
|
8624
|
+
});
|
|
8625
|
+
}
|
|
8626
|
+
if (bounds.depth > MENU_MAX_TREE_DEPTH) {
|
|
8627
|
+
context.addIssue({
|
|
8628
|
+
code: "custom",
|
|
8629
|
+
message: `Menu input exceeds maximum depth ${MENU_MAX_TREE_DEPTH}.`
|
|
8630
|
+
});
|
|
8631
|
+
}
|
|
8632
|
+
if (bounds.values > MENU_MAX_INPUT_VALUES) {
|
|
8633
|
+
context.addIssue({
|
|
8634
|
+
code: "custom",
|
|
8635
|
+
message: `Menu input exceeds ${MENU_MAX_INPUT_VALUES} values.`
|
|
8636
|
+
});
|
|
8637
|
+
}
|
|
8638
|
+
});
|
|
8639
|
+
var MenuPageRefSchema = z10.object({
|
|
8640
|
+
applicationId: ContractIdentifierSchema,
|
|
8641
|
+
pageId: ContractIdentifierSchema
|
|
8642
|
+
}).strict();
|
|
8643
|
+
var MenuSourceInputBindingSchema = z10.discriminatedUnion("exposure", [
|
|
8644
|
+
z10.object({ exposure: z10.literal("client"), value: MenuBoundedInputSchema }).strict(),
|
|
8645
|
+
z10.object({ exposure: z10.literal("server"), value: MenuBoundedInputSchema }).strict()
|
|
8646
|
+
]);
|
|
8647
|
+
var MenuRuntimeInputBindingSchema = z10.discriminatedUnion("exposure", [
|
|
8648
|
+
z10.object({ exposure: z10.literal("client"), value: MenuBoundedInputSchema }).strict(),
|
|
8649
|
+
z10.object({ exposure: z10.literal("server") }).strict()
|
|
8650
|
+
]);
|
|
8651
|
+
var MenuNavigateBehaviorSchema = z10.object({
|
|
8652
|
+
kind: z10.literal("navigate"),
|
|
8653
|
+
page: MenuPageRefSchema,
|
|
8654
|
+
activationId: ContractIdentifierSchema.optional(),
|
|
8655
|
+
input: MenuSourceInputBindingSchema.optional()
|
|
8656
|
+
}).strict();
|
|
8657
|
+
var MenuActionBehaviorSchema = z10.object({
|
|
8658
|
+
kind: z10.literal("action"),
|
|
8659
|
+
actionRef: ContractIdentifierSchema,
|
|
8660
|
+
input: MenuBoundedInputSchema.optional()
|
|
8661
|
+
}).strict();
|
|
8662
|
+
var MenuBehaviorSchema = z10.discriminatedUnion("kind", [
|
|
8663
|
+
MenuNavigateBehaviorSchema,
|
|
8664
|
+
MenuActionBehaviorSchema
|
|
8665
|
+
]);
|
|
8666
|
+
var MenuNodeBaseShape = {
|
|
8667
|
+
nodeId: ContractIdentifierSchema,
|
|
8668
|
+
parentNodeId: ContractIdentifierSchema.optional(),
|
|
8669
|
+
order: MenuOrderSchema
|
|
8670
|
+
};
|
|
8671
|
+
var MenuGroupNodeSchema = z10.object({
|
|
8672
|
+
...MenuNodeBaseShape,
|
|
8673
|
+
kind: z10.literal("group"),
|
|
8674
|
+
label: LocalizedTextSchema.optional(),
|
|
8675
|
+
iconRef: ContractIdentifierSchema.optional()
|
|
8676
|
+
}).strict();
|
|
8677
|
+
var MenuDividerNodeSchema = z10.object({
|
|
8678
|
+
...MenuNodeBaseShape,
|
|
8679
|
+
kind: z10.literal("divider")
|
|
8680
|
+
}).strict();
|
|
8681
|
+
var MenuItemNodeSchema = z10.object({
|
|
8682
|
+
...MenuNodeBaseShape,
|
|
8683
|
+
kind: z10.literal("item"),
|
|
8684
|
+
label: LocalizedTextSchema,
|
|
8685
|
+
iconRef: ContractIdentifierSchema.optional(),
|
|
8686
|
+
tone: z10.enum(["default", "danger"]).optional(),
|
|
8687
|
+
requiredPermission: ContractIdentifierSchema.optional(),
|
|
8688
|
+
behavior: MenuBehaviorSchema
|
|
8689
|
+
}).strict();
|
|
8690
|
+
var MenuNodeSchema = z10.discriminatedUnion("kind", [
|
|
8691
|
+
MenuGroupNodeSchema,
|
|
8692
|
+
MenuDividerNodeSchema,
|
|
8693
|
+
MenuItemNodeSchema
|
|
8694
|
+
]);
|
|
8695
|
+
var MenuContributionSchema = z10.object({
|
|
8696
|
+
providerId: ContractIdentifierSchema,
|
|
8697
|
+
parentNodeId: ContractIdentifierSchema.optional(),
|
|
8698
|
+
order: MenuOrderSchema
|
|
8699
|
+
}).strict();
|
|
8700
|
+
var validateMenuStructure = (menu, context) => {
|
|
8701
|
+
const nodesById = /* @__PURE__ */ new Map();
|
|
8702
|
+
menu.nodes.forEach((node, index) => {
|
|
8703
|
+
if (nodesById.has(node.nodeId)) {
|
|
8704
|
+
context.addIssue({
|
|
8705
|
+
code: "custom",
|
|
8706
|
+
path: ["nodes", index, "nodeId"],
|
|
8707
|
+
message: `Duplicate menu nodeId: ${node.nodeId}`
|
|
8708
|
+
});
|
|
8709
|
+
return;
|
|
8710
|
+
}
|
|
8711
|
+
nodesById.set(node.nodeId, { node, index });
|
|
8712
|
+
});
|
|
8713
|
+
const validateParent = (parentNodeId, path) => {
|
|
8714
|
+
if (!parentNodeId) return;
|
|
8715
|
+
const parent = nodesById.get(parentNodeId);
|
|
8716
|
+
if (!parent) {
|
|
8717
|
+
context.addIssue({ code: "custom", path, message: `Unknown menu parentNodeId: ${parentNodeId}` });
|
|
8718
|
+
return;
|
|
8719
|
+
}
|
|
8720
|
+
if (parent.node.kind !== "group") {
|
|
8721
|
+
context.addIssue({ code: "custom", path, message: `Menu parent ${parentNodeId} must be a group.` });
|
|
8722
|
+
}
|
|
8723
|
+
};
|
|
8724
|
+
menu.nodes.forEach((node, index) => validateParent(node.parentNodeId, ["nodes", index, "parentNodeId"]));
|
|
8725
|
+
menu.contributions.forEach((contribution, index) => validateParent(contribution.parentNodeId, ["contributions", index, "parentNodeId"]));
|
|
8726
|
+
menu.nodes.forEach((node, index) => {
|
|
8727
|
+
const ancestors = /* @__PURE__ */ new Set([node.nodeId]);
|
|
8728
|
+
let parentNodeId = node.parentNodeId;
|
|
8729
|
+
let depth = 1;
|
|
8730
|
+
while (parentNodeId) {
|
|
8731
|
+
if (ancestors.has(parentNodeId)) {
|
|
8732
|
+
context.addIssue({
|
|
8733
|
+
code: "custom",
|
|
8734
|
+
path: ["nodes", index, "parentNodeId"],
|
|
8735
|
+
message: `Menu node cycle contains ${node.nodeId}.`
|
|
8736
|
+
});
|
|
8737
|
+
break;
|
|
8738
|
+
}
|
|
8739
|
+
ancestors.add(parentNodeId);
|
|
8740
|
+
depth += 1;
|
|
8741
|
+
if (depth > MENU_MAX_TREE_DEPTH) {
|
|
8742
|
+
context.addIssue({
|
|
8743
|
+
code: "custom",
|
|
8744
|
+
path: ["nodes", index, "parentNodeId"],
|
|
8745
|
+
message: `Menu tree exceeds maximum depth ${MENU_MAX_TREE_DEPTH}.`
|
|
8746
|
+
});
|
|
8747
|
+
break;
|
|
8748
|
+
}
|
|
8749
|
+
parentNodeId = nodesById.get(parentNodeId)?.node.parentNodeId;
|
|
8750
|
+
}
|
|
8751
|
+
});
|
|
8752
|
+
const contributionKeys = /* @__PURE__ */ new Set();
|
|
8753
|
+
menu.contributions.forEach((contribution, index) => {
|
|
8754
|
+
const key = `${contribution.parentNodeId ?? ""}\0${contribution.providerId}`;
|
|
8755
|
+
if (contributionKeys.has(key)) {
|
|
8756
|
+
context.addIssue({
|
|
8757
|
+
code: "custom",
|
|
8758
|
+
path: ["contributions", index, "providerId"],
|
|
8759
|
+
message: `Duplicate menu contribution provider at parent: ${contribution.providerId}`
|
|
8760
|
+
});
|
|
8761
|
+
}
|
|
8762
|
+
contributionKeys.add(key);
|
|
8763
|
+
});
|
|
8764
|
+
};
|
|
8765
|
+
var MenuDefinitionSchema = z10.object({
|
|
8766
|
+
contract: z10.literal("MenuDefinition"),
|
|
8767
|
+
version: z10.literal(MENU_CONTRACT_VERSION),
|
|
8768
|
+
applicationId: ContractIdentifierSchema,
|
|
8769
|
+
surface: ContractIdentifierSchema,
|
|
8770
|
+
menuId: ContractIdentifierSchema,
|
|
8771
|
+
nodes: z10.array(MenuNodeSchema).max(MENU_MAX_NODES),
|
|
8772
|
+
contributions: z10.array(MenuContributionSchema).max(MENU_MAX_NODES).default([])
|
|
8773
|
+
}).strict().superRefine(validateMenuStructure);
|
|
8774
|
+
var MenuDefinitionSetSchema = z10.union([
|
|
8775
|
+
z10.literal("*"),
|
|
8776
|
+
z10.object({
|
|
8777
|
+
version: z10.literal(MENU_CONTRACT_VERSION),
|
|
8778
|
+
definitions: z10.array(MenuDefinitionSchema).max(MENU_MAX_DEFINITIONS)
|
|
8779
|
+
}).strict()
|
|
8780
|
+
]);
|
|
8781
|
+
var MenuAccessRequirementSchema = z10.object({
|
|
8782
|
+
authenticated: z10.boolean().default(true),
|
|
8783
|
+
permissionAllOf: z10.array(ContractIdentifierSchema).default([]),
|
|
8784
|
+
permissionAnyOf: z10.array(ContractIdentifierSchema).default([]),
|
|
8785
|
+
featureFlags: z10.array(ContractIdentifierSchema).default([])
|
|
8786
|
+
}).strict();
|
|
8787
|
+
var MenuPageRegistrationSchema = z10.object({
|
|
8788
|
+
applicationId: ContractIdentifierSchema,
|
|
8789
|
+
page: PageDefinitionSchema
|
|
8790
|
+
}).strict();
|
|
8791
|
+
var MenuActionRegistrationSchema = z10.object({
|
|
8792
|
+
applicationId: ContractIdentifierSchema,
|
|
8793
|
+
actionRef: ContractIdentifierSchema,
|
|
8794
|
+
inputSchemaRef: ContractIdentifierSchema.optional(),
|
|
8795
|
+
access: MenuAccessRequirementSchema
|
|
8796
|
+
}).strict();
|
|
8797
|
+
var MenuContributionProviderRegistrationSchema = z10.object({
|
|
8798
|
+
applicationId: ContractIdentifierSchema,
|
|
8799
|
+
providerId: ContractIdentifierSchema,
|
|
8800
|
+
surfaces: z10.array(ContractIdentifierSchema).min(1).optional()
|
|
8801
|
+
}).strict();
|
|
8802
|
+
var CompiledMenuNavigateBehaviorSchema = z10.object({
|
|
8803
|
+
kind: z10.literal("navigate"),
|
|
8804
|
+
page: MenuPageRefSchema,
|
|
8805
|
+
activationId: ContractIdentifierSchema,
|
|
8806
|
+
input: MenuRuntimeInputBindingSchema.optional()
|
|
8807
|
+
}).strict();
|
|
8808
|
+
var CompiledMenuActionBehaviorSchema = z10.object({
|
|
8809
|
+
kind: z10.literal("action"),
|
|
8810
|
+
actionRef: ContractIdentifierSchema,
|
|
8811
|
+
input: MenuBoundedInputSchema.optional()
|
|
8812
|
+
}).strict();
|
|
8813
|
+
var CompiledMenuBehaviorSchema = z10.discriminatedUnion("kind", [
|
|
8814
|
+
CompiledMenuNavigateBehaviorSchema,
|
|
8815
|
+
CompiledMenuActionBehaviorSchema
|
|
8816
|
+
]);
|
|
8817
|
+
var CompiledMenuItemAccessSchema = MenuAccessRequirementSchema.extend({
|
|
8818
|
+
requiredPermission: ContractIdentifierSchema.optional()
|
|
8819
|
+
}).strict();
|
|
8820
|
+
var CompiledMenuGroupNodeSchema = MenuGroupNodeSchema;
|
|
8821
|
+
var CompiledMenuDividerNodeSchema = MenuDividerNodeSchema;
|
|
8822
|
+
var CompiledMenuItemNodeSchema = MenuItemNodeSchema.omit({ behavior: true, requiredPermission: true }).extend({
|
|
8823
|
+
behavior: CompiledMenuBehaviorSchema,
|
|
8824
|
+
access: CompiledMenuItemAccessSchema
|
|
8825
|
+
}).strict();
|
|
8826
|
+
var CompiledMenuNodeSchema = z10.discriminatedUnion("kind", [
|
|
8827
|
+
CompiledMenuGroupNodeSchema,
|
|
8828
|
+
CompiledMenuDividerNodeSchema,
|
|
8829
|
+
CompiledMenuItemNodeSchema
|
|
8830
|
+
]);
|
|
8831
|
+
var CompiledMenuProjectionSchema = z10.object({
|
|
8832
|
+
applicationId: ContractIdentifierSchema,
|
|
8833
|
+
surface: ContractIdentifierSchema,
|
|
8834
|
+
menuId: ContractIdentifierSchema,
|
|
8835
|
+
nodes: z10.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES),
|
|
8836
|
+
contributions: z10.array(MenuContributionSchema).max(MENU_MAX_NODES)
|
|
8837
|
+
}).strict();
|
|
8838
|
+
var MenuNavigationTargetSchema = z10.object({
|
|
8839
|
+
page: MenuPageRefSchema,
|
|
8840
|
+
activationId: ContractIdentifierSchema,
|
|
8841
|
+
input: MenuRuntimeInputBindingSchema.optional()
|
|
8842
|
+
}).strict();
|
|
8843
|
+
var MenuRuntimeBundleSchema = z10.object({
|
|
8844
|
+
contract: z10.literal("MenuRuntimeBundle"),
|
|
8845
|
+
version: z10.literal(MENU_CONTRACT_VERSION),
|
|
8846
|
+
applicationId: ContractIdentifierSchema,
|
|
8847
|
+
sourceVersion: ContractIdentifierSchema,
|
|
8848
|
+
contentHash: Sha256Schema,
|
|
8849
|
+
menus: z10.array(CompiledMenuProjectionSchema).max(MENU_MAX_DEFINITIONS),
|
|
8850
|
+
navigationTargets: z10.array(MenuNavigationTargetSchema),
|
|
8851
|
+
sourceMap: z10.record(z10.string(), ContractIdentifierSchema).default({})
|
|
8852
|
+
}).strict();
|
|
8853
|
+
var MenuContributionResultSchema = z10.object({
|
|
8854
|
+
contract: z10.literal("MenuContributionResult"),
|
|
8855
|
+
applicationId: ContractIdentifierSchema,
|
|
8856
|
+
surface: ContractIdentifierSchema,
|
|
8857
|
+
menuId: ContractIdentifierSchema,
|
|
8858
|
+
providerId: ContractIdentifierSchema,
|
|
8859
|
+
nodes: z10.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES)
|
|
8860
|
+
}).strict();
|
|
8861
|
+
|
|
8582
8862
|
// src/contracts/semantic.ts
|
|
8583
|
-
import { z as
|
|
8584
|
-
var ConceptRelationshipSchema =
|
|
8863
|
+
import { z as z11 } from "zod";
|
|
8864
|
+
var ConceptRelationshipSchema = z11.object({
|
|
8585
8865
|
kind: ContractIdentifierSchema,
|
|
8586
8866
|
targetConceptId: ContractIdentifierSchema,
|
|
8587
|
-
cardinality:
|
|
8867
|
+
cardinality: z11.enum(["one", "optional", "many"])
|
|
8588
8868
|
}).strict();
|
|
8589
|
-
var ConceptDefinitionSchema =
|
|
8590
|
-
contract:
|
|
8869
|
+
var ConceptDefinitionSchema = z11.object({
|
|
8870
|
+
contract: z11.literal("ConceptDefinition"),
|
|
8591
8871
|
conceptId: ContractIdentifierSchema,
|
|
8592
8872
|
ownerRepo: ContractIdentifierSchema,
|
|
8593
|
-
displayName:
|
|
8594
|
-
description:
|
|
8873
|
+
displayName: z11.string().trim().min(1),
|
|
8874
|
+
description: z11.string().optional(),
|
|
8595
8875
|
schemaRef: ContractIdentifierSchema,
|
|
8596
8876
|
ontologyId: ContractIdentifierSchema.optional(),
|
|
8597
|
-
capabilityIds:
|
|
8598
|
-
commandNames:
|
|
8599
|
-
relationships:
|
|
8877
|
+
capabilityIds: z11.array(ContractIdentifierSchema).default([]),
|
|
8878
|
+
commandNames: z11.array(ContractIdentifierSchema).default([]),
|
|
8879
|
+
relationships: z11.array(ConceptRelationshipSchema).default([])
|
|
8600
8880
|
}).strict();
|
|
8601
|
-
var DomainCommandDefinitionSchema =
|
|
8602
|
-
contract:
|
|
8881
|
+
var DomainCommandDefinitionSchema = z11.object({
|
|
8882
|
+
contract: z11.literal("DomainCommandDefinition"),
|
|
8603
8883
|
commandName: ContractIdentifierSchema,
|
|
8604
8884
|
ownerRepo: ContractIdentifierSchema,
|
|
8605
|
-
displayName:
|
|
8606
|
-
description:
|
|
8607
|
-
targetKinds:
|
|
8885
|
+
displayName: z11.string().trim().min(1),
|
|
8886
|
+
description: z11.string().optional(),
|
|
8887
|
+
targetKinds: z11.array(ContractIdentifierSchema).min(1),
|
|
8608
8888
|
inputSchemaRef: ContractIdentifierSchema,
|
|
8609
8889
|
outputSchemaRef: ContractIdentifierSchema.optional(),
|
|
8610
|
-
requiredPermissionCodes:
|
|
8890
|
+
requiredPermissionCodes: z11.array(ContractIdentifierSchema).default([]),
|
|
8611
8891
|
handlerRef: EntityRefSchema,
|
|
8612
|
-
sideEffects:
|
|
8892
|
+
sideEffects: z11.array(z11.enum(["data-write", "execution", "navigation", "notification", "external-call"])).default([])
|
|
8613
8893
|
}).strict();
|
|
8614
|
-
var DomainCommandSchema =
|
|
8615
|
-
contract:
|
|
8894
|
+
var DomainCommandSchema = z11.object({
|
|
8895
|
+
contract: z11.literal("DomainCommand"),
|
|
8616
8896
|
commandId: ContractIdentifierSchema,
|
|
8617
8897
|
commandName: ContractIdentifierSchema,
|
|
8618
8898
|
requestId: ContractIdentifierSchema,
|
|
@@ -8620,29 +8900,30 @@ var DomainCommandSchema = z10.object({
|
|
|
8620
8900
|
idempotencyKey: ContractIdentifierSchema,
|
|
8621
8901
|
targetRef: EntityRefSchema,
|
|
8622
8902
|
actorRef: EntityRefSchema,
|
|
8623
|
-
source:
|
|
8624
|
-
product:
|
|
8903
|
+
source: z11.object({
|
|
8904
|
+
product: z11.enum(["studio", "kernel", "compute", "agent", "mcp", "service"]),
|
|
8625
8905
|
pageId: ContractIdentifierSchema.optional(),
|
|
8626
8906
|
capabilityId: ContractIdentifierSchema.optional()
|
|
8627
8907
|
}).strict(),
|
|
8628
8908
|
payload: JsonObjectSchema,
|
|
8629
8909
|
issuedAt: IsoDateTimeSchema
|
|
8630
8910
|
}).strict();
|
|
8631
|
-
var ProductDeclarationSchema =
|
|
8632
|
-
contract:
|
|
8911
|
+
var ProductDeclarationSchema = z11.object({
|
|
8912
|
+
contract: z11.literal("ProductDeclaration"),
|
|
8633
8913
|
declarationId: ContractIdentifierSchema,
|
|
8634
8914
|
ownerRepo: ContractIdentifierSchema,
|
|
8635
|
-
concepts:
|
|
8636
|
-
ontologies:
|
|
8637
|
-
projections:
|
|
8638
|
-
commands:
|
|
8639
|
-
capabilities:
|
|
8640
|
-
pages:
|
|
8641
|
-
|
|
8642
|
-
|
|
8915
|
+
concepts: z11.array(ConceptDefinitionSchema).default([]),
|
|
8916
|
+
ontologies: z11.array(OntologyDefinitionSchema).default([]),
|
|
8917
|
+
projections: z11.array(ProjectionSpecSchema).default([]),
|
|
8918
|
+
commands: z11.array(DomainCommandDefinitionSchema).default([]),
|
|
8919
|
+
capabilities: z11.array(CapabilityManifestSchema).default([]),
|
|
8920
|
+
pages: z11.array(PageDefinitionSchema).default([]),
|
|
8921
|
+
menus: z11.array(MenuDefinitionSchema).default([])
|
|
8922
|
+
}).strict();
|
|
8923
|
+
var DeclarationGraphEdgeSchema = z11.object({
|
|
8643
8924
|
from: EntityRefSchema,
|
|
8644
8925
|
to: EntityRefSchema,
|
|
8645
|
-
relation:
|
|
8926
|
+
relation: z11.enum([
|
|
8646
8927
|
"uses-ontology",
|
|
8647
8928
|
"uses-projection",
|
|
8648
8929
|
"uses-capability",
|
|
@@ -8650,25 +8931,25 @@ var DeclarationGraphEdgeSchema = z10.object({
|
|
|
8650
8931
|
"relates-to-concept"
|
|
8651
8932
|
])
|
|
8652
8933
|
}).strict();
|
|
8653
|
-
var ChangeImpactSchema =
|
|
8934
|
+
var ChangeImpactSchema = z11.object({
|
|
8654
8935
|
changedRef: EntityRefSchema,
|
|
8655
|
-
affectedRefs:
|
|
8656
|
-
reasons:
|
|
8936
|
+
affectedRefs: z11.array(EntityRefSchema),
|
|
8937
|
+
reasons: z11.array(ContractIdentifierSchema).min(1)
|
|
8657
8938
|
}).strict();
|
|
8658
|
-
var ChangeImpactGraphSchema =
|
|
8659
|
-
contract:
|
|
8939
|
+
var ChangeImpactGraphSchema = z11.object({
|
|
8940
|
+
contract: z11.literal("ChangeImpactGraph"),
|
|
8660
8941
|
declarationId: ContractIdentifierSchema,
|
|
8661
|
-
nodes:
|
|
8662
|
-
edges:
|
|
8663
|
-
impacts:
|
|
8942
|
+
nodes: z11.array(EntityRefSchema),
|
|
8943
|
+
edges: z11.array(DeclarationGraphEdgeSchema),
|
|
8944
|
+
impacts: z11.array(ChangeImpactSchema),
|
|
8664
8945
|
generatedAt: IsoDateTimeSchema
|
|
8665
8946
|
}).strict();
|
|
8666
8947
|
|
|
8667
8948
|
// src/contracts/tenant.ts
|
|
8668
|
-
import { z as
|
|
8949
|
+
import { z as z13 } from "zod";
|
|
8669
8950
|
|
|
8670
8951
|
// src/contracts/theme.ts
|
|
8671
|
-
import { z as
|
|
8952
|
+
import { z as z12 } from "zod";
|
|
8672
8953
|
|
|
8673
8954
|
// src/theme-tokens/core.ts
|
|
8674
8955
|
var import_ajv = __toESM(require_ajv());
|
|
@@ -10895,20 +11176,20 @@ function assertMonkeysThemeTokensComplete(input) {
|
|
|
10895
11176
|
}
|
|
10896
11177
|
|
|
10897
11178
|
// src/contracts/theme.ts
|
|
10898
|
-
var ThemeTokenTypeSchema =
|
|
10899
|
-
var ThemeTokenSchema =
|
|
11179
|
+
var ThemeTokenTypeSchema = z12.enum(THEME_TOKEN_TYPES);
|
|
11180
|
+
var ThemeTokenSchema = z12.record(z12.string(), z12.unknown()).superRefine((input, context) => {
|
|
10900
11181
|
const issues = validateThemeTokensDocumentStructure({ token: input });
|
|
10901
11182
|
for (const issue of issues) {
|
|
10902
11183
|
context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
|
|
10903
11184
|
}
|
|
10904
11185
|
});
|
|
10905
|
-
var ThemeTokenGroupSchema =
|
|
11186
|
+
var ThemeTokenGroupSchema = z12.record(z12.string(), z12.unknown()).superRefine((input, context) => {
|
|
10906
11187
|
const issues = validateThemeTokensDocumentStructure(input);
|
|
10907
11188
|
for (const issue of issues) {
|
|
10908
11189
|
context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
|
|
10909
11190
|
}
|
|
10910
11191
|
});
|
|
10911
|
-
var ThemeTokensSchema =
|
|
11192
|
+
var ThemeTokensSchema = z12.record(z12.string(), z12.unknown()).superRefine((input, context) => {
|
|
10912
11193
|
const issues = validateThemeTokensDocument(input);
|
|
10913
11194
|
for (const issue of issues) {
|
|
10914
11195
|
context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
|
|
@@ -10935,9 +11216,9 @@ var ResolvedThemeTokensSchema = ThemeTokensSchema.superRefine((input, context) =
|
|
|
10935
11216
|
});
|
|
10936
11217
|
|
|
10937
11218
|
// src/contracts/tenant.ts
|
|
10938
|
-
var DesignTokenFileSourceSchema =
|
|
10939
|
-
type:
|
|
10940
|
-
path:
|
|
11219
|
+
var DesignTokenFileSourceSchema = z13.object({
|
|
11220
|
+
type: z13.literal("file"),
|
|
11221
|
+
path: z13.string().trim().min(1).superRefine((source, context) => {
|
|
10941
11222
|
if (/^[a-z][a-z\d+.-]*:/i.test(source)) {
|
|
10942
11223
|
context.addIssue({
|
|
10943
11224
|
code: "custom",
|
|
@@ -10946,9 +11227,9 @@ var DesignTokenFileSourceSchema = z12.object({
|
|
|
10946
11227
|
}
|
|
10947
11228
|
})
|
|
10948
11229
|
}).strict();
|
|
10949
|
-
var DesignTokenUrlSourceSchema =
|
|
10950
|
-
type:
|
|
10951
|
-
url:
|
|
11230
|
+
var DesignTokenUrlSourceSchema = z13.object({
|
|
11231
|
+
type: z13.literal("url"),
|
|
11232
|
+
url: z13.string().trim().min(1).superRefine((source, context) => {
|
|
10952
11233
|
if (!/^https?:\/\//i.test(source)) {
|
|
10953
11234
|
context.addIssue({
|
|
10954
11235
|
code: "custom",
|
|
@@ -10957,118 +11238,207 @@ var DesignTokenUrlSourceSchema = z12.object({
|
|
|
10957
11238
|
}
|
|
10958
11239
|
})
|
|
10959
11240
|
}).strict();
|
|
10960
|
-
var DesignTokenInlineSourceSchema =
|
|
10961
|
-
type:
|
|
11241
|
+
var DesignTokenInlineSourceSchema = z13.object({
|
|
11242
|
+
type: z13.literal("inline"),
|
|
10962
11243
|
document: ThemeTokensSchema
|
|
10963
11244
|
}).strict();
|
|
10964
|
-
var DesignTokenSourceSchema =
|
|
11245
|
+
var DesignTokenSourceSchema = z13.discriminatedUnion("type", [
|
|
10965
11246
|
DesignTokenFileSourceSchema,
|
|
10966
11247
|
DesignTokenUrlSourceSchema,
|
|
10967
11248
|
DesignTokenInlineSourceSchema
|
|
10968
11249
|
]);
|
|
10969
|
-
var TenantDesignTokensConfigSchema =
|
|
11250
|
+
var TenantDesignTokensConfigSchema = z13.object({
|
|
10970
11251
|
/** Ordered tenant overrides. The backend always applies the product default first. */
|
|
10971
|
-
tokenSources:
|
|
11252
|
+
tokenSources: z13.array(DesignTokenSourceSchema)
|
|
10972
11253
|
}).strict();
|
|
10973
|
-
var TenantAuthBindingSchema =
|
|
10974
|
-
kind:
|
|
11254
|
+
var TenantAuthBindingSchema = z13.object({
|
|
11255
|
+
kind: z13.literal("auth-provider"),
|
|
10975
11256
|
providerId: ContractIdentifierSchema,
|
|
10976
11257
|
policyRef: ContractIdentifierSchema.optional()
|
|
10977
11258
|
}).strict();
|
|
10978
|
-
var TenantDataBindingSchema =
|
|
10979
|
-
|
|
10980
|
-
kind:
|
|
11259
|
+
var TenantDataBindingSchema = z13.discriminatedUnion("kind", [
|
|
11260
|
+
z13.object({
|
|
11261
|
+
kind: z13.literal("data-provider"),
|
|
10981
11262
|
providerId: ContractIdentifierSchema,
|
|
10982
11263
|
domainRef: ContractIdentifierSchema.optional()
|
|
10983
11264
|
}).strict(),
|
|
10984
|
-
|
|
10985
|
-
kind:
|
|
11265
|
+
z13.object({
|
|
11266
|
+
kind: z13.literal("projection"),
|
|
10986
11267
|
projectionRef: ContractIdentifierSchema,
|
|
10987
11268
|
domainRef: ContractIdentifierSchema.optional()
|
|
10988
11269
|
}).strict()
|
|
10989
11270
|
]);
|
|
10990
|
-
var TenantAuthBindingsSchema =
|
|
11271
|
+
var TenantAuthBindingsSchema = z13.record(
|
|
10991
11272
|
ContractIdentifierSchema,
|
|
10992
11273
|
TenantAuthBindingSchema
|
|
10993
11274
|
);
|
|
10994
|
-
var TenantDataBindingsSchema =
|
|
11275
|
+
var TenantDataBindingsSchema = z13.record(
|
|
10995
11276
|
ContractIdentifierSchema,
|
|
10996
11277
|
TenantDataBindingSchema
|
|
10997
11278
|
);
|
|
10998
|
-
var TenantTrendRadarSourceSchema =
|
|
11279
|
+
var TenantTrendRadarSourceSchema = z13.object({
|
|
10999
11280
|
ontologyId: ContractIdentifierSchema,
|
|
11000
11281
|
viewId: ContractIdentifierSchema
|
|
11001
11282
|
}).strict();
|
|
11002
|
-
var TenantTrendRadarSourcesSchema =
|
|
11283
|
+
var TenantTrendRadarSourcesSchema = z13.object({
|
|
11003
11284
|
hotwords: TenantTrendRadarSourceSchema.optional(),
|
|
11004
11285
|
brands: TenantTrendRadarSourceSchema.optional()
|
|
11005
11286
|
}).strict();
|
|
11006
|
-
var AssetVariantsSchema =
|
|
11007
|
-
light:
|
|
11008
|
-
dark:
|
|
11287
|
+
var AssetVariantsSchema = z13.object({
|
|
11288
|
+
light: z13.string().optional(),
|
|
11289
|
+
dark: z13.string().optional()
|
|
11009
11290
|
}).strict();
|
|
11010
|
-
var
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11291
|
+
var LEGACY_CURRENT_USER_MENU_ITEM_IDS = ["dark-mode", "language", "settings", "logout"];
|
|
11292
|
+
var CURRENT_USER_MENU_CONTROL_REFS = ["dark-mode", "language"];
|
|
11293
|
+
var CURRENT_USER_MENU_ACTION_REFS = ["logout"];
|
|
11294
|
+
var CurrentUserMenuIdentifierSchema = z13.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
|
|
11295
|
+
var CurrentUserMenuDisplayTextSchema = z13.union([
|
|
11296
|
+
z13.string().trim().min(1),
|
|
11297
|
+
z13.record(z13.string().trim().min(1), z13.string().trim().min(1)).refine((value) => Object.keys(value).length > 0, "Localized menu text must contain at least one locale.")
|
|
11298
|
+
]);
|
|
11299
|
+
var CurrentUserMenuNavigationItemSchema = z13.object({
|
|
11300
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
11301
|
+
kind: z13.literal("navigation"),
|
|
11302
|
+
ref: CurrentUserMenuIdentifierSchema
|
|
11303
|
+
}).strict();
|
|
11304
|
+
var CurrentUserMenuControlItemSchema = z13.object({
|
|
11305
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
11306
|
+
kind: z13.literal("control"),
|
|
11307
|
+
ref: z13.enum(CURRENT_USER_MENU_CONTROL_REFS)
|
|
11016
11308
|
}).strict();
|
|
11017
|
-
var
|
|
11309
|
+
var CurrentUserMenuActionItemSchema = z13.object({
|
|
11310
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
11311
|
+
kind: z13.literal("action"),
|
|
11312
|
+
ref: z13.enum(CURRENT_USER_MENU_ACTION_REFS),
|
|
11313
|
+
tone: z13.enum(["default", "danger"]).optional()
|
|
11314
|
+
}).strict();
|
|
11315
|
+
var CurrentUserMenuItemSchema = z13.discriminatedUnion("kind", [
|
|
11316
|
+
CurrentUserMenuNavigationItemSchema,
|
|
11317
|
+
CurrentUserMenuControlItemSchema,
|
|
11318
|
+
CurrentUserMenuActionItemSchema
|
|
11319
|
+
]);
|
|
11320
|
+
var CurrentUserMenuSectionSchema = z13.object({
|
|
11321
|
+
id: CurrentUserMenuIdentifierSchema,
|
|
11322
|
+
label: CurrentUserMenuDisplayTextSchema.optional(),
|
|
11323
|
+
dividerBefore: z13.boolean().optional(),
|
|
11324
|
+
items: z13.array(CurrentUserMenuItemSchema)
|
|
11325
|
+
}).strict();
|
|
11326
|
+
var CurrentUserMenuConfigSchema = z13.object({
|
|
11327
|
+
version: z13.literal(1),
|
|
11328
|
+
sections: z13.array(CurrentUserMenuSectionSchema).max(20)
|
|
11329
|
+
}).strict().superRefine((value, context) => {
|
|
11330
|
+
const sectionIds = /* @__PURE__ */ new Set();
|
|
11331
|
+
const itemIds = /* @__PURE__ */ new Set();
|
|
11332
|
+
let itemCount = 0;
|
|
11333
|
+
value.sections.forEach((section, sectionIndex) => {
|
|
11334
|
+
if (sectionIds.has(section.id)) {
|
|
11335
|
+
context.addIssue({
|
|
11336
|
+
code: "custom",
|
|
11337
|
+
message: `Duplicate current-user menu section id ${section.id}.`,
|
|
11338
|
+
path: ["sections", sectionIndex, "id"]
|
|
11339
|
+
});
|
|
11340
|
+
}
|
|
11341
|
+
sectionIds.add(section.id);
|
|
11342
|
+
itemCount += section.items.length;
|
|
11343
|
+
section.items.forEach((item, itemIndex) => {
|
|
11344
|
+
if (itemIds.has(item.id)) {
|
|
11345
|
+
context.addIssue({
|
|
11346
|
+
code: "custom",
|
|
11347
|
+
message: `Duplicate current-user menu item id ${item.id}.`,
|
|
11348
|
+
path: ["sections", sectionIndex, "items", itemIndex, "id"]
|
|
11349
|
+
});
|
|
11350
|
+
}
|
|
11351
|
+
itemIds.add(item.id);
|
|
11352
|
+
});
|
|
11353
|
+
});
|
|
11354
|
+
if (itemCount > 100) {
|
|
11355
|
+
context.addIssue({
|
|
11356
|
+
code: "custom",
|
|
11357
|
+
message: "Current-user menu supports at most 100 items.",
|
|
11358
|
+
path: ["sections"]
|
|
11359
|
+
});
|
|
11360
|
+
}
|
|
11361
|
+
});
|
|
11362
|
+
var LegacyCurrentUserMenuProfileSchema = z13.array(z13.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
|
|
11363
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11364
|
+
value.forEach((item, index) => {
|
|
11365
|
+
if (seen.has(item)) {
|
|
11366
|
+
context.addIssue({
|
|
11367
|
+
code: "custom",
|
|
11368
|
+
message: `Duplicate legacy current-user menu item ${item}.`,
|
|
11369
|
+
path: [index]
|
|
11370
|
+
});
|
|
11371
|
+
}
|
|
11372
|
+
seen.add(item);
|
|
11373
|
+
});
|
|
11374
|
+
});
|
|
11375
|
+
var CurrentUserMenuProfileSchema = z13.union([
|
|
11376
|
+
z13.literal("*"),
|
|
11377
|
+
LegacyCurrentUserMenuProfileSchema,
|
|
11378
|
+
CurrentUserMenuConfigSchema
|
|
11379
|
+
]);
|
|
11380
|
+
var ThemeHeadbarSchema = z13.object({
|
|
11381
|
+
theme: z13.enum(["card", "glassy", "ghost"]).optional(),
|
|
11382
|
+
navPosition: z13.enum(["left", "center", "right"]).optional(),
|
|
11383
|
+
actions: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]).optional(),
|
|
11384
|
+
profile: CurrentUserMenuProfileSchema.optional(),
|
|
11385
|
+
showTeamQuota: z13.boolean().optional()
|
|
11386
|
+
}).strict();
|
|
11387
|
+
var TenantHeadbarModuleLeafSchema = z13.object({
|
|
11018
11388
|
id: ContractIdentifierSchema,
|
|
11019
|
-
extraInfo:
|
|
11020
|
-
displayName:
|
|
11021
|
-
visible:
|
|
11022
|
-
disabled:
|
|
11023
|
-
icon:
|
|
11024
|
-
showQuickSwitcher:
|
|
11025
|
-
showSidebar:
|
|
11026
|
-
showContentFrame:
|
|
11389
|
+
extraInfo: z13.boolean().optional(),
|
|
11390
|
+
displayName: z13.union([z13.string(), z13.record(LocaleIdentifierSchema, z13.string())]).optional(),
|
|
11391
|
+
visible: z13.boolean().optional(),
|
|
11392
|
+
disabled: z13.boolean().optional(),
|
|
11393
|
+
icon: z13.string().optional(),
|
|
11394
|
+
showQuickSwitcher: z13.boolean().optional(),
|
|
11395
|
+
showSidebar: z13.boolean().optional(),
|
|
11396
|
+
showContentFrame: z13.boolean().optional()
|
|
11027
11397
|
}).strict();
|
|
11028
11398
|
var TenantHeadbarModuleItemSchema = TenantHeadbarModuleLeafSchema.extend({
|
|
11029
|
-
children:
|
|
11030
|
-
}).strict();
|
|
11031
|
-
var KernelHeadbarSchema =
|
|
11032
|
-
theme:
|
|
11033
|
-
layoutMode:
|
|
11034
|
-
heightPx:
|
|
11035
|
-
navPosition:
|
|
11036
|
-
brandTitle:
|
|
11037
|
-
menuRadius:
|
|
11038
|
-
}).strict();
|
|
11039
|
-
var CustomIconSchema =
|
|
11040
|
-
color:
|
|
11041
|
-
url:
|
|
11042
|
-
type:
|
|
11043
|
-
hintTextColor:
|
|
11044
|
-
}).strict();
|
|
11045
|
-
var WorkbenchCustomerToolSchema =
|
|
11399
|
+
children: z13.array(TenantHeadbarModuleLeafSchema).optional()
|
|
11400
|
+
}).strict();
|
|
11401
|
+
var KernelHeadbarSchema = z13.object({
|
|
11402
|
+
theme: z13.literal("card").optional(),
|
|
11403
|
+
layoutMode: z13.enum(["boxed", "full-bleed"]).optional(),
|
|
11404
|
+
heightPx: z13.number().positive().optional(),
|
|
11405
|
+
navPosition: z13.enum(["left", "center", "right"]).optional(),
|
|
11406
|
+
brandTitle: z13.string().optional(),
|
|
11407
|
+
menuRadius: z13.enum(["default", "none", "sm", "md", "lg", "xl", "full"]).optional()
|
|
11408
|
+
}).strict();
|
|
11409
|
+
var CustomIconSchema = z13.object({
|
|
11410
|
+
color: z13.string().optional(),
|
|
11411
|
+
url: z13.string().optional(),
|
|
11412
|
+
type: z13.enum(["svg", "image"]).optional(),
|
|
11413
|
+
hintTextColor: z13.string().optional()
|
|
11414
|
+
}).strict();
|
|
11415
|
+
var WorkbenchCustomerToolSchema = z13.object({
|
|
11046
11416
|
id: ContractIdentifierSchema,
|
|
11047
|
-
label:
|
|
11048
|
-
fixed:
|
|
11417
|
+
label: z13.union([z13.string(), z13.record(LocaleIdentifierSchema, z13.string())]).optional(),
|
|
11418
|
+
fixed: z13.boolean().optional()
|
|
11049
11419
|
}).strict();
|
|
11050
|
-
var WorkbenchStudioOverrideSchema =
|
|
11051
|
-
studioName:
|
|
11052
|
-
dropdownToolsDefault:
|
|
11053
|
-
existingToolsDefault:
|
|
11054
|
-
historyColumnsDefault:
|
|
11420
|
+
var WorkbenchStudioOverrideSchema = z13.object({
|
|
11421
|
+
studioName: z13.string().trim().min(1),
|
|
11422
|
+
dropdownToolsDefault: z13.array(ContractIdentifierSchema).optional(),
|
|
11423
|
+
existingToolsDefault: z13.array(ContractIdentifierSchema).optional(),
|
|
11424
|
+
historyColumnsDefault: z13.number().int().min(1).max(6).optional()
|
|
11055
11425
|
}).strict();
|
|
11056
|
-
var TenantWorkbenchPageContextSchema =
|
|
11426
|
+
var TenantWorkbenchPageContextSchema = z13.object({
|
|
11057
11427
|
workflow: JsonObjectSchema.optional(),
|
|
11058
11428
|
agent: JsonObjectSchema.optional(),
|
|
11059
11429
|
agentId: ContractIdentifierSchema.optional(),
|
|
11060
11430
|
designProject: JsonObjectSchema.optional(),
|
|
11061
11431
|
designMetadataId: ContractIdentifierSchema.optional(),
|
|
11062
|
-
iframeUrl:
|
|
11063
|
-
info:
|
|
11432
|
+
iframeUrl: z13.string().trim().min(1).optional(),
|
|
11433
|
+
info: z13.object({
|
|
11064
11434
|
displayName: LocalizedTextSchema.optional(),
|
|
11065
11435
|
description: LocalizedTextSchema.optional(),
|
|
11066
|
-
iconUrl:
|
|
11436
|
+
iconUrl: z13.string().trim().min(1).optional()
|
|
11067
11437
|
}).strict().optional(),
|
|
11068
|
-
isBuiltinPinned:
|
|
11069
|
-
isBuiltinReadonly:
|
|
11438
|
+
isBuiltinPinned: z13.boolean().optional(),
|
|
11439
|
+
isBuiltinReadonly: z13.boolean().optional()
|
|
11070
11440
|
}).strict();
|
|
11071
|
-
var TenantWorkbenchPageEnvelopeSchema =
|
|
11441
|
+
var TenantWorkbenchPageEnvelopeSchema = z13.object({
|
|
11072
11442
|
definition: PageDefinitionSchema,
|
|
11073
11443
|
context: TenantWorkbenchPageContextSchema
|
|
11074
11444
|
}).strict().superRefine(({ definition }, context) => {
|
|
@@ -11101,56 +11471,56 @@ var TenantWorkbenchPageEnvelopeSchema = z12.object({
|
|
|
11101
11471
|
});
|
|
11102
11472
|
}
|
|
11103
11473
|
});
|
|
11104
|
-
var TenantWorkbenchPageGroupSchema =
|
|
11474
|
+
var TenantWorkbenchPageGroupSchema = z13.object({
|
|
11105
11475
|
id: ContractIdentifierSchema,
|
|
11106
|
-
pageIds:
|
|
11476
|
+
pageIds: z13.array(ContractIdentifierSchema),
|
|
11107
11477
|
displayName: LocalizedTextSchema,
|
|
11108
|
-
isBuiltIn:
|
|
11109
|
-
iconUrl:
|
|
11110
|
-
sortIndex:
|
|
11478
|
+
isBuiltIn: z13.boolean(),
|
|
11479
|
+
iconUrl: z13.string().optional(),
|
|
11480
|
+
sortIndex: z13.number().int().nullable().optional(),
|
|
11111
11481
|
presetRelationId: ContractIdentifierSchema.optional(),
|
|
11112
11482
|
relationKey: ContractIdentifierSchema.nullable().optional(),
|
|
11113
11483
|
studioId: ContractIdentifierSchema.optional()
|
|
11114
11484
|
}).strict();
|
|
11115
|
-
var TenantWorkbenchConfigSchema =
|
|
11116
|
-
pages:
|
|
11117
|
-
pageGroups:
|
|
11118
|
-
catalog:
|
|
11119
|
-
quickSwitcherMaxItems:
|
|
11120
|
-
defaultOrder:
|
|
11121
|
-
groups:
|
|
11122
|
-
pages:
|
|
11485
|
+
var TenantWorkbenchConfigSchema = z13.object({
|
|
11486
|
+
pages: z13.array(TenantWorkbenchPageEnvelopeSchema),
|
|
11487
|
+
pageGroups: z13.array(TenantWorkbenchPageGroupSchema),
|
|
11488
|
+
catalog: z13.object({ enabled: z13.boolean().optional(), defaultEntry: z13.boolean().optional() }).strict().optional(),
|
|
11489
|
+
quickSwitcherMaxItems: z13.number().int().nonnegative().optional(),
|
|
11490
|
+
defaultOrder: z13.object({
|
|
11491
|
+
groups: z13.array(ContractIdentifierSchema),
|
|
11492
|
+
pages: z13.record(ContractIdentifierSchema, z13.array(ContractIdentifierSchema))
|
|
11123
11493
|
}).strict().optional(),
|
|
11124
|
-
customers:
|
|
11125
|
-
dropdownToolsDefault:
|
|
11126
|
-
layoutManagerTools:
|
|
11127
|
-
studioTabsMode:
|
|
11128
|
-
historyWatermark:
|
|
11129
|
-
svgUrl:
|
|
11130
|
-
coverage:
|
|
11131
|
-
maxLongEdgeRatio:
|
|
11132
|
-
sizing:
|
|
11494
|
+
customers: z13.object({
|
|
11495
|
+
dropdownToolsDefault: z13.array(ContractIdentifierSchema).optional(),
|
|
11496
|
+
layoutManagerTools: z13.array(WorkbenchCustomerToolSchema).optional(),
|
|
11497
|
+
studioTabsMode: z13.enum(["dropdown", "tabs"]).optional(),
|
|
11498
|
+
historyWatermark: z13.object({
|
|
11499
|
+
svgUrl: z13.string().optional(),
|
|
11500
|
+
coverage: z13.array(z13.enum(["list", "detail", "download"])).optional(),
|
|
11501
|
+
maxLongEdgeRatio: z13.number().positive().optional(),
|
|
11502
|
+
sizing: z13.object({
|
|
11133
11503
|
mode: ContractIdentifierSchema,
|
|
11134
|
-
heightRatio:
|
|
11135
|
-
minHeightPx:
|
|
11136
|
-
maxHeightPx:
|
|
11504
|
+
heightRatio: z13.number().positive().optional(),
|
|
11505
|
+
minHeightPx: z13.number().nonnegative().optional(),
|
|
11506
|
+
maxHeightPx: z13.number().nonnegative().optional()
|
|
11137
11507
|
}).strict().optional(),
|
|
11138
|
-
enhance:
|
|
11139
|
-
enabled:
|
|
11140
|
-
backgroundLumaThreshold:
|
|
11141
|
-
stroke:
|
|
11142
|
-
color:
|
|
11143
|
-
opacity:
|
|
11144
|
-
widthRatio:
|
|
11145
|
-
blurRatio:
|
|
11146
|
-
steps:
|
|
11508
|
+
enhance: z13.object({
|
|
11509
|
+
enabled: z13.boolean().optional(),
|
|
11510
|
+
backgroundLumaThreshold: z13.number().min(0).max(1).optional(),
|
|
11511
|
+
stroke: z13.object({
|
|
11512
|
+
color: z13.string().optional(),
|
|
11513
|
+
opacity: z13.number().min(0).max(1).optional(),
|
|
11514
|
+
widthRatio: z13.number().nonnegative().optional(),
|
|
11515
|
+
blurRatio: z13.number().nonnegative().optional(),
|
|
11516
|
+
steps: z13.number().int().positive().optional()
|
|
11147
11517
|
}).strict().optional()
|
|
11148
11518
|
}).strict().optional()
|
|
11149
11519
|
}).strict().optional(),
|
|
11150
|
-
layoutManagerEnabled:
|
|
11151
|
-
existingToolsDefault:
|
|
11152
|
-
historyColumnsDefault:
|
|
11153
|
-
studioOverrides:
|
|
11520
|
+
layoutManagerEnabled: z13.boolean().optional(),
|
|
11521
|
+
existingToolsDefault: z13.array(ContractIdentifierSchema).optional(),
|
|
11522
|
+
historyColumnsDefault: z13.number().int().min(1).max(6).optional(),
|
|
11523
|
+
studioOverrides: z13.array(WorkbenchStudioOverrideSchema).optional()
|
|
11154
11524
|
}).strict().optional()
|
|
11155
11525
|
}).strict().superRefine(({ pages, pageGroups }, context) => {
|
|
11156
11526
|
const pageIds = pages.map(({ definition }) => definition.pageId);
|
|
@@ -11174,38 +11544,38 @@ var TenantWorkbenchConfigSchema = z12.object({
|
|
|
11174
11544
|
});
|
|
11175
11545
|
});
|
|
11176
11546
|
});
|
|
11177
|
-
var LoginPageSchema =
|
|
11178
|
-
background:
|
|
11179
|
-
logo:
|
|
11180
|
-
url:
|
|
11181
|
-
lightUrl:
|
|
11182
|
-
darkUrl:
|
|
11183
|
-
position:
|
|
11184
|
-
scale:
|
|
11547
|
+
var LoginPageSchema = z13.object({
|
|
11548
|
+
background: z13.object({ imageUrl: z13.string().optional(), gradient: z13.string().optional() }).strict().optional(),
|
|
11549
|
+
logo: z13.object({
|
|
11550
|
+
url: z13.string().optional(),
|
|
11551
|
+
lightUrl: z13.string().optional(),
|
|
11552
|
+
darkUrl: z13.string().optional(),
|
|
11553
|
+
position: z13.enum(["top", "middle", "bottom"]).optional(),
|
|
11554
|
+
scale: z13.number().positive().optional()
|
|
11185
11555
|
}).strict().optional(),
|
|
11186
|
-
customCss:
|
|
11556
|
+
customCss: z13.string().optional()
|
|
11187
11557
|
}).strict();
|
|
11188
11558
|
var LandingPageHeadbarConfigShape = {
|
|
11189
|
-
headbarMode:
|
|
11559
|
+
headbarMode: z13.enum(["shared", "hidden"]).optional()
|
|
11190
11560
|
};
|
|
11191
|
-
var LandingPageDefaultConfigSchema =
|
|
11192
|
-
mode:
|
|
11561
|
+
var LandingPageDefaultConfigSchema = z13.object({
|
|
11562
|
+
mode: z13.literal("default"),
|
|
11193
11563
|
...LandingPageHeadbarConfigShape
|
|
11194
11564
|
}).strict();
|
|
11195
|
-
var LandingPageMarkdownConfigSchema =
|
|
11196
|
-
mode:
|
|
11197
|
-
content:
|
|
11565
|
+
var LandingPageMarkdownConfigSchema = z13.object({
|
|
11566
|
+
mode: z13.literal("markdown"),
|
|
11567
|
+
content: z13.string(),
|
|
11198
11568
|
...LandingPageHeadbarConfigShape
|
|
11199
11569
|
}).strict();
|
|
11200
|
-
var LandingPageHtmlConfigSchema =
|
|
11201
|
-
mode:
|
|
11202
|
-
content:
|
|
11570
|
+
var LandingPageHtmlConfigSchema = z13.object({
|
|
11571
|
+
mode: z13.literal("html"),
|
|
11572
|
+
content: z13.string(),
|
|
11203
11573
|
...LandingPageHeadbarConfigShape
|
|
11204
11574
|
}).strict();
|
|
11205
|
-
var LandingPageIframeConfigSchema =
|
|
11206
|
-
mode:
|
|
11575
|
+
var LandingPageIframeConfigSchema = z13.object({
|
|
11576
|
+
mode: z13.literal("iframe"),
|
|
11207
11577
|
...LandingPageHeadbarConfigShape,
|
|
11208
|
-
url:
|
|
11578
|
+
url: z13.string().refine((value) => {
|
|
11209
11579
|
if (/^\/(?!\/)/.test(value)) {
|
|
11210
11580
|
return !value.includes("\\");
|
|
11211
11581
|
}
|
|
@@ -11217,422 +11587,424 @@ var LandingPageIframeConfigSchema = z12.object({
|
|
|
11217
11587
|
}
|
|
11218
11588
|
}, "Landing page iframe URL must use a root-relative path or HTTP(S) without embedded credentials.")
|
|
11219
11589
|
}).strict();
|
|
11220
|
-
var TenantLandingPageConfigSchema =
|
|
11590
|
+
var TenantLandingPageConfigSchema = z13.discriminatedUnion("mode", [
|
|
11221
11591
|
LandingPageDefaultConfigSchema,
|
|
11222
11592
|
LandingPageMarkdownConfigSchema,
|
|
11223
11593
|
LandingPageHtmlConfigSchema,
|
|
11224
11594
|
LandingPageIframeConfigSchema
|
|
11225
11595
|
]);
|
|
11226
|
-
var TenantApplicationConfigSchema =
|
|
11227
|
-
theme:
|
|
11228
|
-
id:
|
|
11229
|
-
name:
|
|
11230
|
-
title:
|
|
11596
|
+
var TenantApplicationConfigSchema = z13.object({
|
|
11597
|
+
theme: z13.object({
|
|
11598
|
+
id: z13.string().optional(),
|
|
11599
|
+
name: z13.string().optional(),
|
|
11600
|
+
title: z13.string().optional(),
|
|
11231
11601
|
favicon: AssetVariantsSchema.optional(),
|
|
11232
11602
|
logo: AssetVariantsSchema.optional(),
|
|
11233
|
-
pwaIcon:
|
|
11234
|
-
form:
|
|
11235
|
-
toast:
|
|
11236
|
-
position:
|
|
11603
|
+
pwaIcon: z13.string().optional(),
|
|
11604
|
+
form: z13.object({ variant: z13.enum(["bento", "ghost"]) }).strict().optional(),
|
|
11605
|
+
toast: z13.object({
|
|
11606
|
+
position: z13.enum(["top-right", "top-left", "bottom-right", "bottom-left", "top-center", "bottom-center"])
|
|
11237
11607
|
}).strict().optional(),
|
|
11238
|
-
icons:
|
|
11239
|
-
views:
|
|
11240
|
-
form:
|
|
11241
|
-
toast:
|
|
11242
|
-
progress:
|
|
11243
|
-
onlyResult:
|
|
11244
|
-
tabular:
|
|
11608
|
+
icons: z13.object({ error: CustomIconSchema.optional(), empty: CustomIconSchema.optional() }).strict().optional(),
|
|
11609
|
+
views: z13.object({
|
|
11610
|
+
form: z13.object({
|
|
11611
|
+
toast: z13.object({ afterCreate: z13.boolean(), afterDelete: z13.boolean() }).strict(),
|
|
11612
|
+
progress: z13.enum(["estimate", "infinite"]),
|
|
11613
|
+
onlyResult: z13.boolean(),
|
|
11614
|
+
tabular: z13.object({ theme: z13.enum(["default", "tentiary", "primary"]) }).strict()
|
|
11245
11615
|
}).strict()
|
|
11246
11616
|
}).strict().optional(),
|
|
11247
11617
|
loginPage: LoginPageSchema.optional(),
|
|
11248
|
-
extraLanguageURL:
|
|
11249
|
-
hideSpaceHeader:
|
|
11250
|
-
showSidebarTeamSelector:
|
|
11251
|
-
showWorkbenchSidebar:
|
|
11252
|
-
workbenchViewTheme:
|
|
11253
|
-
defaults:
|
|
11254
|
-
showFormInImageDetail:
|
|
11255
|
-
darkMode:
|
|
11256
|
-
language:
|
|
11257
|
-
showDarkModeToggle:
|
|
11258
|
-
showLanguageToggle:
|
|
11618
|
+
extraLanguageURL: z13.record(z13.string(), z13.string()).optional(),
|
|
11619
|
+
hideSpaceHeader: z13.boolean().optional(),
|
|
11620
|
+
showSidebarTeamSelector: z13.boolean().optional(),
|
|
11621
|
+
showWorkbenchSidebar: z13.boolean().optional(),
|
|
11622
|
+
workbenchViewTheme: z13.enum(["default", "bsd-blue"]).optional(),
|
|
11623
|
+
defaults: z13.object({
|
|
11624
|
+
showFormInImageDetail: z13.boolean().optional(),
|
|
11625
|
+
darkMode: z13.enum(["light", "dark", "auto"]).optional(),
|
|
11626
|
+
language: z13.enum(["en-US", "zh-CN", "ja-JP"]).optional(),
|
|
11627
|
+
showDarkModeToggle: z13.boolean().optional(),
|
|
11628
|
+
showLanguageToggle: z13.boolean().optional()
|
|
11259
11629
|
}).strict().optional(),
|
|
11260
|
-
modules:
|
|
11261
|
-
monkeysSpaceSidebar:
|
|
11262
|
-
monkeysSpaceHeadbar:
|
|
11263
|
-
|
|
11264
|
-
|
|
11630
|
+
modules: z13.object({
|
|
11631
|
+
monkeysSpaceSidebar: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]).optional(),
|
|
11632
|
+
monkeysSpaceHeadbar: z13.union([
|
|
11633
|
+
z13.literal("*"),
|
|
11634
|
+
z13.array(TenantHeadbarModuleItemSchema)
|
|
11265
11635
|
]).optional(),
|
|
11266
|
-
settingsSidebar:
|
|
11636
|
+
settingsSidebar: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]).optional()
|
|
11267
11637
|
}).strict().optional(),
|
|
11268
11638
|
headbar: ThemeHeadbarSchema.optional(),
|
|
11269
|
-
kernelLayout:
|
|
11270
|
-
navigationMode:
|
|
11271
|
-
allowNavigationModeSwitch:
|
|
11639
|
+
kernelLayout: z13.object({
|
|
11640
|
+
navigationMode: z13.enum(["sidebar", "topbar"]).optional(),
|
|
11641
|
+
allowNavigationModeSwitch: z13.boolean().optional(),
|
|
11272
11642
|
headbar: KernelHeadbarSchema.optional()
|
|
11273
11643
|
}).strict().optional(),
|
|
11274
|
-
paginationPosition:
|
|
11275
|
-
ugcViewIconOnlyMode:
|
|
11276
|
-
workflowPreviewExecutionGrid:
|
|
11277
|
-
selectionModeDisplayType:
|
|
11278
|
-
clickBehavior:
|
|
11279
|
-
showErrorFilter:
|
|
11280
|
-
displayType:
|
|
11281
|
-
showDetailButton:
|
|
11644
|
+
paginationPosition: z13.enum(["left", "right"]).optional(),
|
|
11645
|
+
ugcViewIconOnlyMode: z13.boolean().optional(),
|
|
11646
|
+
workflowPreviewExecutionGrid: z13.object({
|
|
11647
|
+
selectionModeDisplayType: z13.enum(["operation-button", "dropdown-menu"]).optional(),
|
|
11648
|
+
clickBehavior: z13.enum(["preview", "select", "fill-form", "none"]).optional(),
|
|
11649
|
+
showErrorFilter: z13.boolean().optional(),
|
|
11650
|
+
displayType: z13.enum(["grid", "masonry"]).optional(),
|
|
11651
|
+
showDetailButton: z13.boolean().optional()
|
|
11282
11652
|
}).strict().optional(),
|
|
11283
|
-
workbenchSidebarDefaultOpen:
|
|
11284
|
-
workbenchSidebarMoreAction:
|
|
11285
|
-
workbenchSidebarApart:
|
|
11286
|
-
workbenchSidebarToggleGroupDetail:
|
|
11287
|
-
workbenchSidebarViewType:
|
|
11288
|
-
workbenchSidebarFormViewEmbed:
|
|
11289
|
-
workbenchSidebarModernMode:
|
|
11290
|
-
ugc:
|
|
11291
|
-
uniImagePreview:
|
|
11292
|
-
imagePreviewStyle:
|
|
11293
|
-
teamAsUser:
|
|
11294
|
-
themeMode:
|
|
11295
|
-
density:
|
|
11296
|
-
pageZoom:
|
|
11297
|
-
miniMode:
|
|
11298
|
-
workflow:
|
|
11299
|
-
historyResult:
|
|
11300
|
-
uploader:
|
|
11301
|
-
orientation:
|
|
11302
|
-
pasteButton:
|
|
11303
|
-
statusText:
|
|
11653
|
+
workbenchSidebarDefaultOpen: z13.boolean().optional(),
|
|
11654
|
+
workbenchSidebarMoreAction: z13.boolean().optional(),
|
|
11655
|
+
workbenchSidebarApart: z13.boolean().optional(),
|
|
11656
|
+
workbenchSidebarToggleGroupDetail: z13.boolean().optional(),
|
|
11657
|
+
workbenchSidebarViewType: z13.boolean().optional(),
|
|
11658
|
+
workbenchSidebarFormViewEmbed: z13.boolean().optional(),
|
|
11659
|
+
workbenchSidebarModernMode: z13.boolean().optional(),
|
|
11660
|
+
ugc: z13.object({ onItemClick: z13.boolean(), subtitle: z13.boolean().optional() }).strict().optional(),
|
|
11661
|
+
uniImagePreview: z13.boolean().optional(),
|
|
11662
|
+
imagePreviewStyle: z13.union([z13.literal(false), z13.enum(["simple", "normal", "uni"])]).optional(),
|
|
11663
|
+
teamAsUser: z13.boolean().optional(),
|
|
11664
|
+
themeMode: z13.enum(["shadow", "border"]).optional(),
|
|
11665
|
+
density: z13.enum(["compact", "default", "comfortable"]).optional(),
|
|
11666
|
+
pageZoom: z13.number().positive().optional(),
|
|
11667
|
+
miniMode: z13.object({ showPreviewViewExecutionResultGrid: z13.boolean() }).strict().optional(),
|
|
11668
|
+
workflow: z13.object({ allowConcurrentRuns: z13.boolean() }).strict().optional(),
|
|
11669
|
+
historyResult: z13.object({ display: z13.boolean() }).strict().optional(),
|
|
11670
|
+
uploader: z13.object({
|
|
11671
|
+
orientation: z13.enum(["vertical", "horizontal"]),
|
|
11672
|
+
pasteButton: z13.boolean(),
|
|
11673
|
+
statusText: z13.boolean()
|
|
11304
11674
|
}).strict().optional(),
|
|
11305
|
-
designProjects:
|
|
11306
|
-
oneOnOne:
|
|
11307
|
-
newTabOpenBoard:
|
|
11308
|
-
defaultShowGrid:
|
|
11309
|
-
createDefaultFrame:
|
|
11310
|
-
showPageMenu:
|
|
11311
|
-
showMainMenu:
|
|
11312
|
-
showStylePanel:
|
|
11313
|
-
showToolbar:
|
|
11314
|
-
toolbarPosition:
|
|
11315
|
-
showContextMenu:
|
|
11316
|
-
showActionsMenu:
|
|
11317
|
-
showPageAndLayerSidebar:
|
|
11318
|
-
showBoardOperationSidebar:
|
|
11319
|
-
showMiniToolsToolbar:
|
|
11320
|
-
showRightSidebar:
|
|
11321
|
-
showRealtimeDrawing:
|
|
11322
|
-
showWorkflow:
|
|
11323
|
-
showVersionManager:
|
|
11324
|
-
showAgent:
|
|
11325
|
-
AgentTools:
|
|
11675
|
+
designProjects: z13.object({
|
|
11676
|
+
oneOnOne: z13.boolean(),
|
|
11677
|
+
newTabOpenBoard: z13.boolean(),
|
|
11678
|
+
defaultShowGrid: z13.boolean().optional(),
|
|
11679
|
+
createDefaultFrame: z13.boolean(),
|
|
11680
|
+
showPageMenu: z13.boolean(),
|
|
11681
|
+
showMainMenu: z13.boolean(),
|
|
11682
|
+
showStylePanel: z13.boolean(),
|
|
11683
|
+
showToolbar: z13.boolean(),
|
|
11684
|
+
toolbarPosition: z13.enum(["bottom", "left"]).optional(),
|
|
11685
|
+
showContextMenu: z13.boolean(),
|
|
11686
|
+
showActionsMenu: z13.boolean(),
|
|
11687
|
+
showPageAndLayerSidebar: z13.boolean().optional(),
|
|
11688
|
+
showBoardOperationSidebar: z13.boolean().optional(),
|
|
11689
|
+
showMiniToolsToolbar: z13.boolean().optional(),
|
|
11690
|
+
showRightSidebar: z13.boolean().optional(),
|
|
11691
|
+
showRealtimeDrawing: z13.boolean().optional(),
|
|
11692
|
+
showWorkflow: z13.boolean().optional(),
|
|
11693
|
+
showVersionManager: z13.boolean().optional(),
|
|
11694
|
+
showAgent: z13.boolean().optional(),
|
|
11695
|
+
AgentTools: z13.array(ContractIdentifierSchema).optional()
|
|
11326
11696
|
}).strict().optional(),
|
|
11327
11697
|
workbench: TenantWorkbenchConfigSchema.optional(),
|
|
11328
|
-
visionProWorkflows:
|
|
11329
|
-
initTeam:
|
|
11330
|
-
imageThumbnail:
|
|
11331
|
-
pages:
|
|
11332
|
-
allowPageKeys:
|
|
11698
|
+
visionProWorkflows: z13.array(ContractIdentifierSchema).optional(),
|
|
11699
|
+
initTeam: z13.boolean().optional(),
|
|
11700
|
+
imageThumbnail: z13.boolean().optional(),
|
|
11701
|
+
pages: z13.object({
|
|
11702
|
+
allowPageKeys: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]),
|
|
11333
11703
|
defaultPageKey: ContractIdentifierSchema.optional()
|
|
11334
11704
|
}).strict().optional(),
|
|
11335
|
-
agent:
|
|
11705
|
+
agent: z13.object({
|
|
11336
11706
|
logo: AssetVariantsSchema.optional(),
|
|
11337
|
-
brandDisplayMode:
|
|
11338
|
-
density:
|
|
11707
|
+
brandDisplayMode: z13.enum(["auto", "logo-only", "logo-name", "name-only"]).optional(),
|
|
11708
|
+
density: z13.enum(["compact", "default", "comfortable"]).optional()
|
|
11339
11709
|
}).strict().optional()
|
|
11340
11710
|
}).strict(),
|
|
11341
11711
|
landingPage: TenantLandingPageConfigSchema.optional(),
|
|
11342
|
-
auth:
|
|
11343
|
-
enabled:
|
|
11344
|
-
oidc:
|
|
11345
|
-
password:
|
|
11346
|
-
hideAuthToast:
|
|
11347
|
-
autoReload:
|
|
11348
|
-
defaultOtherTeam:
|
|
11712
|
+
auth: z13.object({
|
|
11713
|
+
enabled: z13.array(ContractIdentifierSchema).default([]),
|
|
11714
|
+
oidc: z13.object({ buttonText: z13.string().optional(), autoSignin: z13.boolean().optional() }).strict().optional(),
|
|
11715
|
+
password: z13.object({ disableAutoRegister: z13.boolean().optional() }).strict().optional(),
|
|
11716
|
+
hideAuthToast: z13.boolean().optional(),
|
|
11717
|
+
autoReload: z13.boolean().optional(),
|
|
11718
|
+
defaultOtherTeam: z13.boolean().optional()
|
|
11349
11719
|
}).strict(),
|
|
11350
|
-
endpoints:
|
|
11351
|
-
module:
|
|
11352
|
-
behavior:
|
|
11353
|
-
clearWorkflowFormStorageAfterUpdate:
|
|
11354
|
-
autoApproveOAuth:
|
|
11355
|
-
rememberWorkflowModelSelection:
|
|
11720
|
+
endpoints: z13.record(ContractIdentifierSchema, z13.string()),
|
|
11721
|
+
module: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]),
|
|
11722
|
+
behavior: z13.object({
|
|
11723
|
+
clearWorkflowFormStorageAfterUpdate: z13.boolean().optional(),
|
|
11724
|
+
autoApproveOAuth: z13.boolean().optional(),
|
|
11725
|
+
rememberWorkflowModelSelection: z13.boolean().optional()
|
|
11356
11726
|
}).strict(),
|
|
11357
|
-
dataManagement:
|
|
11358
|
-
favoriteOntologyId:
|
|
11359
|
-
pairedOntologyId:
|
|
11360
|
-
galleryOntologyIds:
|
|
11361
|
-
galleryOntologyId:
|
|
11362
|
-
dataBrowserDefaultOntologyId:
|
|
11363
|
-
workflowResultOntologyId:
|
|
11364
|
-
homeAdvertisement:
|
|
11727
|
+
dataManagement: z13.object({
|
|
11728
|
+
favoriteOntologyId: z13.string().optional(),
|
|
11729
|
+
pairedOntologyId: z13.string().optional(),
|
|
11730
|
+
galleryOntologyIds: z13.array(ContractIdentifierSchema).max(20).optional(),
|
|
11731
|
+
galleryOntologyId: z13.string().optional(),
|
|
11732
|
+
dataBrowserDefaultOntologyId: z13.string().optional(),
|
|
11733
|
+
workflowResultOntologyId: z13.string().optional(),
|
|
11734
|
+
homeAdvertisement: z13.object({
|
|
11365
11735
|
ontologyId: ContractIdentifierSchema,
|
|
11366
11736
|
viewId: ContractIdentifierSchema.optional(),
|
|
11367
|
-
viewType:
|
|
11737
|
+
viewType: z13.enum(["filter", "container", "share_link"]).optional(),
|
|
11368
11738
|
teamId: ContractIdentifierSchema.optional(),
|
|
11369
|
-
teamOnly:
|
|
11370
|
-
pageSize:
|
|
11371
|
-
sortBy:
|
|
11372
|
-
sortOrder:
|
|
11373
|
-
fieldMap:
|
|
11374
|
-
columnIds:
|
|
11739
|
+
teamOnly: z13.boolean().optional(),
|
|
11740
|
+
pageSize: z13.number().int().positive().optional(),
|
|
11741
|
+
sortBy: z13.enum(["pin_order", "asset_id", "updated_timestamp", "created_timestamp"]).optional(),
|
|
11742
|
+
sortOrder: z13.enum(["asc", "desc"]).optional(),
|
|
11743
|
+
fieldMap: z13.record(z13.string(), z13.string()).optional(),
|
|
11744
|
+
columnIds: z13.record(z13.string(), z13.string()).optional()
|
|
11375
11745
|
}).strict().optional(),
|
|
11376
|
-
homeTrendAssistant:
|
|
11746
|
+
homeTrendAssistant: z13.object({
|
|
11377
11747
|
ontologyId: ContractIdentifierSchema.optional(),
|
|
11378
11748
|
viewId: ContractIdentifierSchema.optional(),
|
|
11379
11749
|
viewInstanceId: ContractIdentifierSchema.optional(),
|
|
11380
|
-
viewName:
|
|
11750
|
+
viewName: z13.string().optional(),
|
|
11381
11751
|
teamId: ContractIdentifierSchema.optional(),
|
|
11382
11752
|
designOptionsWorkflowId: ContractIdentifierSchema.optional(),
|
|
11383
|
-
tep:
|
|
11384
|
-
runtime:
|
|
11753
|
+
tep: z13.object({ baseUrl: z13.string().optional(), timeoutMs: z13.number().int().positive().optional() }).strict().optional(),
|
|
11754
|
+
runtime: z13.object({ appId: ContractIdentifierSchema, tepBaseUrlConfigured: z13.boolean(), tepAuthorizationConfigured: z13.boolean(), tepCookieConfigured: z13.boolean() }).strict().optional()
|
|
11385
11755
|
}).strict().optional(),
|
|
11386
11756
|
trendRadar: TenantTrendRadarSourcesSchema.optional(),
|
|
11387
|
-
sharing:
|
|
11388
|
-
silentViewLinks:
|
|
11389
|
-
shareAccess:
|
|
11390
|
-
shareDialog:
|
|
11391
|
-
audience:
|
|
11392
|
-
accessLevel:
|
|
11393
|
-
viewTreeDelivery:
|
|
11757
|
+
sharing: z13.object({
|
|
11758
|
+
silentViewLinks: z13.object({ enabled: z13.boolean().optional(), placement: z13.object({ mode: z13.enum(["sourceOntology", "ontology"]).optional(), ontologyId: ContractIdentifierSchema.optional(), parentId: ContractIdentifierSchema.optional(), navId: ContractIdentifierSchema.optional() }).strict().optional() }).strict().optional(),
|
|
11759
|
+
shareAccess: z13.object({ publicLinksEnabled: z13.boolean().optional(), passwordGateEnabled: z13.boolean().optional(), passwordAccessTtlSeconds: z13.number().int().positive().optional(), defaultViewTreeDelivery: z13.enum(["manual", "auto"]).optional() }).strict().optional(),
|
|
11760
|
+
shareDialog: z13.object({
|
|
11761
|
+
audience: z13.object({ enabled: z13.boolean().optional(), allowed: z13.array(z13.enum(["user", "team", "public"])).optional(), default: z13.enum(["user", "team", "public"]).optional() }).strict().optional(),
|
|
11762
|
+
accessLevel: z13.object({ enabled: z13.boolean().optional(), allowed: z13.array(z13.enum(["read", "write"])).optional(), default: z13.enum(["read", "write"]).optional() }).strict().optional(),
|
|
11763
|
+
viewTreeDelivery: z13.object({ enabled: z13.boolean().optional(), allowed: z13.array(z13.enum(["manual", "auto"])).optional(), default: z13.enum(["manual", "auto"]).optional() }).strict().optional()
|
|
11394
11764
|
}).strict().optional()
|
|
11395
11765
|
}).strict().optional()
|
|
11396
11766
|
}).strict().optional(),
|
|
11397
|
-
compute:
|
|
11398
|
-
integrations:
|
|
11399
|
-
harbor:
|
|
11400
|
-
gitlab:
|
|
11401
|
-
kubernetes:
|
|
11767
|
+
compute: z13.object({
|
|
11768
|
+
integrations: z13.object({
|
|
11769
|
+
harbor: z13.object({ endpoint: z13.string().optional(), projectScopes: z13.array(z13.string()).optional(), authMode: z13.string().optional(), principal: z13.string().optional(), autoSync: z13.boolean().optional(), proxyUrl: z13.string().optional() }).strict().optional(),
|
|
11770
|
+
gitlab: z13.object({ baseUrl: z13.string().optional(), groupScopes: z13.array(z13.string()).optional(), tokenMode: z13.string().optional(), deployProjectPath: z13.string().optional(), deploymentReportsEnabled: z13.boolean().optional(), proxyUrl: z13.string().optional() }).strict().optional(),
|
|
11771
|
+
kubernetes: z13.object({ accessMode: z13.string().optional(), clusterAlias: z13.string().optional(), agentProjectPath: z13.string().optional(), agentName: z13.string().optional(), namespaceScopes: z13.array(z13.string()).optional(), rolloutObserverEnabled: z13.boolean().optional(), proxyUrl: z13.string().optional() }).strict().optional()
|
|
11402
11772
|
}).strict().optional()
|
|
11403
11773
|
}).strict().optional(),
|
|
11404
|
-
data:
|
|
11405
|
-
storage:
|
|
11406
|
-
presignMode:
|
|
11407
|
-
presign:
|
|
11408
|
-
expiresInSeconds:
|
|
11409
|
-
buckets:
|
|
11410
|
-
|
|
11774
|
+
data: z13.object({}).strict().optional(),
|
|
11775
|
+
storage: z13.object({
|
|
11776
|
+
presignMode: z13.enum(["frontend", "backend", "both"]).optional(),
|
|
11777
|
+
presign: z13.object({
|
|
11778
|
+
expiresInSeconds: z13.number().int().positive(),
|
|
11779
|
+
buckets: z13.array(
|
|
11780
|
+
z13.object({
|
|
11411
11781
|
id: ContractIdentifierSchema,
|
|
11412
11782
|
provider: ContractIdentifierSchema,
|
|
11413
11783
|
preferredUrlPatternId: ContractIdentifierSchema,
|
|
11414
|
-
urlPatterns:
|
|
11415
|
-
|
|
11784
|
+
urlPatterns: z13.array(
|
|
11785
|
+
z13.object({
|
|
11416
11786
|
id: ContractIdentifierSchema,
|
|
11417
|
-
type:
|
|
11418
|
-
hostname:
|
|
11419
|
-
preferred:
|
|
11420
|
-
bucketSegment:
|
|
11787
|
+
type: z13.enum(["bucket-hostname", "provider-hostname"]),
|
|
11788
|
+
hostname: z13.string().trim().min(1),
|
|
11789
|
+
preferred: z13.boolean().optional(),
|
|
11790
|
+
bucketSegment: z13.string().optional()
|
|
11421
11791
|
}).strict()
|
|
11422
11792
|
)
|
|
11423
11793
|
}).strict()
|
|
11424
11794
|
)
|
|
11425
11795
|
}).strict().optional()
|
|
11426
11796
|
}).strict().optional(),
|
|
11427
|
-
monkeyData:
|
|
11797
|
+
monkeyData: z13.object({ baseUrl: z13.string().optional() }).strict().optional()
|
|
11428
11798
|
}).strict();
|
|
11429
|
-
var TenantProductConfigSchema =
|
|
11430
|
-
contract:
|
|
11799
|
+
var TenantProductConfigSchema = z13.object({
|
|
11800
|
+
contract: z13.literal("TenantProductConfig"),
|
|
11431
11801
|
tenantId: ContractIdentifierSchema,
|
|
11432
11802
|
appId: ContractIdentifierSchema,
|
|
11433
11803
|
environment: ContractIdentifierSchema,
|
|
11434
11804
|
designTokens: TenantDesignTokensConfigSchema,
|
|
11435
|
-
moduleRefs:
|
|
11436
|
-
pageRefs:
|
|
11437
|
-
featureFlags:
|
|
11805
|
+
moduleRefs: z13.array(ContractIdentifierSchema).default([]),
|
|
11806
|
+
pageRefs: z13.array(ContractIdentifierSchema).default([]),
|
|
11807
|
+
featureFlags: z13.record(z13.string(), z13.boolean()).default({}),
|
|
11438
11808
|
authBinding: TenantAuthBindingsSchema,
|
|
11439
11809
|
dataBinding: TenantDataBindingsSchema,
|
|
11440
|
-
sourceMap:
|
|
11441
|
-
warnings:
|
|
11810
|
+
sourceMap: z13.record(z13.string(), ContractIdentifierSchema),
|
|
11811
|
+
warnings: z13.array(z13.string()).default([]),
|
|
11812
|
+
menus: MenuDefinitionSetSchema.optional(),
|
|
11442
11813
|
applicationConfig: TenantApplicationConfigSchema
|
|
11443
11814
|
}).strict();
|
|
11444
|
-
var TenantRuntimeConfigSchema =
|
|
11445
|
-
contract:
|
|
11815
|
+
var TenantRuntimeConfigSchema = z13.object({
|
|
11816
|
+
contract: z13.literal("TenantRuntimeConfig"),
|
|
11446
11817
|
tenantId: ContractIdentifierSchema,
|
|
11447
11818
|
appId: ContractIdentifierSchema,
|
|
11448
11819
|
environment: ContractIdentifierSchema,
|
|
11449
11820
|
designTokens: ResolvedThemeTokensSchema,
|
|
11450
|
-
moduleRefs:
|
|
11451
|
-
pageRefs:
|
|
11452
|
-
featureFlags:
|
|
11821
|
+
moduleRefs: z13.array(ContractIdentifierSchema).default([]),
|
|
11822
|
+
pageRefs: z13.array(ContractIdentifierSchema).default([]),
|
|
11823
|
+
featureFlags: z13.record(z13.string(), z13.boolean()).default({}),
|
|
11453
11824
|
authBinding: TenantAuthBindingsSchema,
|
|
11454
11825
|
dataBinding: TenantDataBindingsSchema,
|
|
11455
|
-
sourceMap:
|
|
11456
|
-
warnings:
|
|
11826
|
+
sourceMap: z13.record(z13.string(), ContractIdentifierSchema),
|
|
11827
|
+
warnings: z13.array(z13.string()).default([]),
|
|
11828
|
+
menuBundle: MenuRuntimeBundleSchema.optional(),
|
|
11457
11829
|
applicationConfig: TenantApplicationConfigSchema
|
|
11458
11830
|
}).strict();
|
|
11459
11831
|
|
|
11460
11832
|
// src/contracts/trend.ts
|
|
11461
|
-
import { z as
|
|
11462
|
-
var RadarDecisionMetricsSchema =
|
|
11463
|
-
currentSales:
|
|
11464
|
-
forecastSales:
|
|
11465
|
-
searchHeat:
|
|
11466
|
-
socialHeat:
|
|
11467
|
-
confidence:
|
|
11468
|
-
}).strict();
|
|
11469
|
-
var TrendSourceSchema =
|
|
11833
|
+
import { z as z14 } from "zod";
|
|
11834
|
+
var RadarDecisionMetricsSchema = z14.object({
|
|
11835
|
+
currentSales: z14.number().finite(),
|
|
11836
|
+
forecastSales: z14.number().finite(),
|
|
11837
|
+
searchHeat: z14.number().finite(),
|
|
11838
|
+
socialHeat: z14.number().finite(),
|
|
11839
|
+
confidence: z14.number().min(0).max(1)
|
|
11840
|
+
}).strict();
|
|
11841
|
+
var TrendSourceSchema = z14.object({
|
|
11470
11842
|
sourceId: ContractIdentifierSchema,
|
|
11471
11843
|
provider: ContractIdentifierSchema,
|
|
11472
|
-
channel:
|
|
11844
|
+
channel: z14.enum(["trend", "ecommerce", "social", "search", "internal"]),
|
|
11473
11845
|
collectedAt: IsoDateTimeSchema,
|
|
11474
|
-
sourceUrl:
|
|
11475
|
-
evidenceRefs:
|
|
11846
|
+
sourceUrl: z14.string().url().optional(),
|
|
11847
|
+
evidenceRefs: z14.array(EntityRefSchema).default([])
|
|
11476
11848
|
}).strict();
|
|
11477
|
-
var TrendIngestRunSchema =
|
|
11478
|
-
contract:
|
|
11849
|
+
var TrendIngestRunSchema = z14.object({
|
|
11850
|
+
contract: z14.literal("TrendIngestRun"),
|
|
11479
11851
|
ingestRunId: ContractIdentifierSchema,
|
|
11480
11852
|
sourceId: ContractIdentifierSchema,
|
|
11481
11853
|
requestId: ContractIdentifierSchema,
|
|
11482
11854
|
idempotencyKey: ContractIdentifierSchema,
|
|
11483
|
-
status:
|
|
11484
|
-
recordCount:
|
|
11485
|
-
errorCount:
|
|
11855
|
+
status: z14.enum(["RUNNING", "SUCCEEDED", "FAILED", "PARTIAL"]),
|
|
11856
|
+
recordCount: z14.number().int().nonnegative(),
|
|
11857
|
+
errorCount: z14.number().int().nonnegative(),
|
|
11486
11858
|
startedAt: IsoDateTimeSchema,
|
|
11487
11859
|
completedAt: IsoDateTimeSchema.optional()
|
|
11488
11860
|
}).strict();
|
|
11489
|
-
var TrendSourceRecordSchema =
|
|
11490
|
-
contract:
|
|
11861
|
+
var TrendSourceRecordSchema = z14.object({
|
|
11862
|
+
contract: z14.literal("TrendSourceRecord"),
|
|
11491
11863
|
sourceRecordId: ContractIdentifierSchema,
|
|
11492
11864
|
source: TrendSourceSchema,
|
|
11493
11865
|
ingestRunRef: EntityRefSchema,
|
|
11494
|
-
recordVersion:
|
|
11866
|
+
recordVersion: z14.number().int().positive(),
|
|
11495
11867
|
contentHash: Sha256Schema,
|
|
11496
11868
|
payload: JsonValueSchema,
|
|
11497
11869
|
idempotencyKey: ContractIdentifierSchema,
|
|
11498
11870
|
collectedAt: IsoDateTimeSchema
|
|
11499
11871
|
}).strict();
|
|
11500
|
-
var HotwordBodySchema =
|
|
11501
|
-
contract:
|
|
11872
|
+
var HotwordBodySchema = z14.object({
|
|
11873
|
+
contract: z14.literal("HotwordBody"),
|
|
11502
11874
|
hotwordId: ContractIdentifierSchema,
|
|
11503
|
-
label:
|
|
11504
|
-
normalizedLabel:
|
|
11505
|
-
categories:
|
|
11506
|
-
sourceRefs:
|
|
11507
|
-
relationRefs:
|
|
11875
|
+
label: z14.string().trim().min(1),
|
|
11876
|
+
normalizedLabel: z14.string().trim().min(1),
|
|
11877
|
+
categories: z14.array(ContractIdentifierSchema).default([]),
|
|
11878
|
+
sourceRefs: z14.array(TrendSourceSchema).min(1),
|
|
11879
|
+
relationRefs: z14.array(EntityRefSchema).default([]),
|
|
11508
11880
|
createdAt: IsoDateTimeSchema,
|
|
11509
11881
|
updatedAt: IsoDateTimeSchema
|
|
11510
11882
|
}).strict();
|
|
11511
11883
|
var CommerceBodyFieldsSchema = {
|
|
11512
|
-
displayName:
|
|
11513
|
-
normalizedName:
|
|
11514
|
-
categories:
|
|
11515
|
-
sourceRefs:
|
|
11516
|
-
relationRefs:
|
|
11884
|
+
displayName: z14.string().trim().min(1),
|
|
11885
|
+
normalizedName: z14.string().trim().min(1),
|
|
11886
|
+
categories: z14.array(ContractIdentifierSchema).default([]),
|
|
11887
|
+
sourceRefs: z14.array(EntityRefSchema).min(1),
|
|
11888
|
+
relationRefs: z14.array(EntityRefSchema).default([]),
|
|
11517
11889
|
createdAt: IsoDateTimeSchema,
|
|
11518
11890
|
updatedAt: IsoDateTimeSchema
|
|
11519
11891
|
};
|
|
11520
|
-
var BrandBodySchema =
|
|
11521
|
-
contract:
|
|
11892
|
+
var BrandBodySchema = z14.object({
|
|
11893
|
+
contract: z14.literal("BrandBody"),
|
|
11522
11894
|
brandId: ContractIdentifierSchema,
|
|
11523
11895
|
...CommerceBodyFieldsSchema
|
|
11524
11896
|
}).strict();
|
|
11525
|
-
var ProductBodySchema =
|
|
11526
|
-
contract:
|
|
11897
|
+
var ProductBodySchema = z14.object({
|
|
11898
|
+
contract: z14.literal("ProductBody"),
|
|
11527
11899
|
productId: ContractIdentifierSchema,
|
|
11528
11900
|
brandRef: EntityRefSchema.optional(),
|
|
11529
11901
|
...CommerceBodyFieldsSchema
|
|
11530
11902
|
}).strict();
|
|
11531
|
-
var TrendMetricSnapshotSchema =
|
|
11532
|
-
contract:
|
|
11903
|
+
var TrendMetricSnapshotSchema = z14.object({
|
|
11904
|
+
contract: z14.literal("TrendMetricSnapshot"),
|
|
11533
11905
|
snapshotId: ContractIdentifierSchema,
|
|
11534
11906
|
subjectRef: EntityRefSchema,
|
|
11535
11907
|
observedAt: IsoDateTimeSchema,
|
|
11536
|
-
metrics:
|
|
11537
|
-
confidence:
|
|
11538
|
-
evidenceRefs:
|
|
11908
|
+
metrics: z14.record(z14.string(), z14.number().finite()),
|
|
11909
|
+
confidence: z14.number().min(0).max(1),
|
|
11910
|
+
evidenceRefs: z14.array(EntityRefSchema).min(1)
|
|
11539
11911
|
}).strict();
|
|
11540
|
-
var RadarScoreModelBodySchema =
|
|
11541
|
-
contract:
|
|
11912
|
+
var RadarScoreModelBodySchema = z14.object({
|
|
11913
|
+
contract: z14.literal("RadarScoreModelBody"),
|
|
11542
11914
|
modelId: ContractIdentifierSchema,
|
|
11543
|
-
version:
|
|
11915
|
+
version: z14.number().int().positive(),
|
|
11544
11916
|
weights: RadarDecisionMetricsSchema,
|
|
11545
|
-
thresholds:
|
|
11546
|
-
explanationRules:
|
|
11917
|
+
thresholds: z14.record(z14.string(), z14.number().finite()).default({}),
|
|
11918
|
+
explanationRules: z14.record(z14.string(), z14.string().trim().min(1)).default({}),
|
|
11547
11919
|
createdAt: IsoDateTimeSchema
|
|
11548
11920
|
}).strict();
|
|
11549
|
-
var RadarScoreProjectionSchema =
|
|
11550
|
-
contract:
|
|
11921
|
+
var RadarScoreProjectionSchema = z14.object({
|
|
11922
|
+
contract: z14.literal("RadarScoreProjection"),
|
|
11551
11923
|
projectionId: ContractIdentifierSchema,
|
|
11552
11924
|
subjectRef: EntityRefSchema,
|
|
11553
11925
|
modelRef: EntityRefSchema,
|
|
11554
|
-
totalScore:
|
|
11926
|
+
totalScore: z14.number().finite(),
|
|
11555
11927
|
dimensions: RadarDecisionMetricsSchema,
|
|
11556
|
-
evidenceRefs:
|
|
11928
|
+
evidenceRefs: z14.array(EntityRefSchema).min(1),
|
|
11557
11929
|
freshnessAt: IsoDateTimeSchema
|
|
11558
11930
|
}).strict();
|
|
11559
|
-
var RadarPanoramaNodeSchema =
|
|
11931
|
+
var RadarPanoramaNodeSchema = z14.object({
|
|
11560
11932
|
ref: EntityRefSchema,
|
|
11561
|
-
label:
|
|
11562
|
-
categories:
|
|
11563
|
-
score:
|
|
11933
|
+
label: z14.string().trim().min(1),
|
|
11934
|
+
categories: z14.array(ContractIdentifierSchema).default([]),
|
|
11935
|
+
score: z14.number().finite().optional(),
|
|
11564
11936
|
freshnessAt: IsoDateTimeSchema.optional()
|
|
11565
11937
|
}).strict();
|
|
11566
|
-
var RadarPanoramaEdgeSchema =
|
|
11938
|
+
var RadarPanoramaEdgeSchema = z14.object({
|
|
11567
11939
|
sourceRef: EntityRefSchema,
|
|
11568
11940
|
targetRef: EntityRefSchema,
|
|
11569
11941
|
relation: ContractIdentifierSchema,
|
|
11570
|
-
evidenceRefs:
|
|
11942
|
+
evidenceRefs: z14.array(EntityRefSchema).default([])
|
|
11571
11943
|
}).strict();
|
|
11572
|
-
var RadarPanoramaSchema =
|
|
11573
|
-
contract:
|
|
11574
|
-
nodes:
|
|
11575
|
-
edges:
|
|
11944
|
+
var RadarPanoramaSchema = z14.object({
|
|
11945
|
+
contract: z14.literal("RadarPanorama"),
|
|
11946
|
+
nodes: z14.array(RadarPanoramaNodeSchema),
|
|
11947
|
+
edges: z14.array(RadarPanoramaEdgeSchema),
|
|
11576
11948
|
generatedAt: IsoDateTimeSchema
|
|
11577
11949
|
}).strict();
|
|
11578
|
-
var BrandGeneticsProfileSchema =
|
|
11579
|
-
contract:
|
|
11950
|
+
var BrandGeneticsProfileSchema = z14.object({
|
|
11951
|
+
contract: z14.literal("BrandGeneticsProfile"),
|
|
11580
11952
|
brandRef: EntityRefSchema,
|
|
11581
|
-
categories:
|
|
11582
|
-
signature:
|
|
11583
|
-
relatedRefs:
|
|
11584
|
-
evidenceRefs:
|
|
11953
|
+
categories: z14.array(ContractIdentifierSchema).default([]),
|
|
11954
|
+
signature: z14.record(ContractIdentifierSchema, z14.number().finite()),
|
|
11955
|
+
relatedRefs: z14.array(EntityRefSchema).default([]),
|
|
11956
|
+
evidenceRefs: z14.array(EntityRefSchema).default([]),
|
|
11585
11957
|
computedAt: IsoDateTimeSchema
|
|
11586
11958
|
}).strict();
|
|
11587
|
-
var RadarOpportunityMatrixPointSchema =
|
|
11959
|
+
var RadarOpportunityMatrixPointSchema = z14.object({
|
|
11588
11960
|
subjectRef: EntityRefSchema,
|
|
11589
|
-
label:
|
|
11590
|
-
x:
|
|
11591
|
-
y:
|
|
11592
|
-
score:
|
|
11593
|
-
evidenceRefs:
|
|
11594
|
-
}).strict();
|
|
11595
|
-
var RadarOpportunityMatrixSchema =
|
|
11596
|
-
contract:
|
|
11597
|
-
xMetric:
|
|
11598
|
-
yMetric:
|
|
11599
|
-
points:
|
|
11961
|
+
label: z14.string().trim().min(1),
|
|
11962
|
+
x: z14.number().finite(),
|
|
11963
|
+
y: z14.number().finite(),
|
|
11964
|
+
score: z14.number().finite(),
|
|
11965
|
+
evidenceRefs: z14.array(EntityRefSchema).default([])
|
|
11966
|
+
}).strict();
|
|
11967
|
+
var RadarOpportunityMatrixSchema = z14.object({
|
|
11968
|
+
contract: z14.literal("RadarOpportunityMatrix"),
|
|
11969
|
+
xMetric: z14.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
|
|
11970
|
+
yMetric: z14.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
|
|
11971
|
+
points: z14.array(RadarOpportunityMatrixPointSchema),
|
|
11600
11972
|
computedAt: IsoDateTimeSchema
|
|
11601
11973
|
}).strict();
|
|
11602
|
-
var RadarQueryBodySchema =
|
|
11603
|
-
contract:
|
|
11974
|
+
var RadarQueryBodySchema = z14.object({
|
|
11975
|
+
contract: z14.literal("RadarQueryBody"),
|
|
11604
11976
|
queryId: ContractIdentifierSchema,
|
|
11605
|
-
filters:
|
|
11606
|
-
sort:
|
|
11977
|
+
filters: z14.record(z14.string(), JsonValueSchema).default({}),
|
|
11978
|
+
sort: z14.object({
|
|
11607
11979
|
field: ContractIdentifierSchema,
|
|
11608
|
-
direction:
|
|
11980
|
+
direction: z14.enum(["asc", "desc"])
|
|
11609
11981
|
}).strict(),
|
|
11610
|
-
pageSize:
|
|
11982
|
+
pageSize: z14.number().int().min(1).max(200),
|
|
11611
11983
|
updatedAt: IsoDateTimeSchema
|
|
11612
11984
|
}).strict();
|
|
11613
|
-
var SavedRadarQuerySchema =
|
|
11614
|
-
contract:
|
|
11985
|
+
var SavedRadarQuerySchema = z14.object({
|
|
11986
|
+
contract: z14.literal("SavedRadarQuery"),
|
|
11615
11987
|
savedQueryId: ContractIdentifierSchema,
|
|
11616
11988
|
teamId: ContractIdentifierSchema,
|
|
11617
11989
|
ownerRef: EntityRefSchema,
|
|
11618
|
-
name:
|
|
11990
|
+
name: z14.string().trim().min(1),
|
|
11619
11991
|
queryRef: EntityRefSchema,
|
|
11620
|
-
expectedVersion:
|
|
11992
|
+
expectedVersion: z14.number().int().nonnegative(),
|
|
11621
11993
|
updatedAt: IsoDateTimeSchema
|
|
11622
11994
|
}).strict();
|
|
11623
|
-
var RadarSelectionSchema =
|
|
11624
|
-
contract:
|
|
11995
|
+
var RadarSelectionSchema = z14.object({
|
|
11996
|
+
contract: z14.literal("RadarSelection"),
|
|
11625
11997
|
selectionId: ContractIdentifierSchema,
|
|
11626
11998
|
teamId: ContractIdentifierSchema,
|
|
11627
11999
|
ownerRef: EntityRefSchema,
|
|
11628
|
-
subjectRefs:
|
|
11629
|
-
status:
|
|
11630
|
-
note:
|
|
11631
|
-
expectedVersion:
|
|
12000
|
+
subjectRefs: z14.array(EntityRefSchema),
|
|
12001
|
+
status: z14.enum(["stashed", "selected", "rejected", "archived"]),
|
|
12002
|
+
note: z14.string().optional(),
|
|
12003
|
+
expectedVersion: z14.number().int().nonnegative(),
|
|
11632
12004
|
updatedAt: IsoDateTimeSchema
|
|
11633
12005
|
}).strict();
|
|
11634
|
-
var RadarAnalysisRunSchema =
|
|
11635
|
-
contract:
|
|
12006
|
+
var RadarAnalysisRunSchema = z14.object({
|
|
12007
|
+
contract: z14.literal("RadarAnalysisRun"),
|
|
11636
12008
|
runId: ContractIdentifierSchema,
|
|
11637
12009
|
teamId: ContractIdentifierSchema,
|
|
11638
12010
|
selectionRef: EntityRefSchema,
|
|
@@ -11641,66 +12013,66 @@ var RadarAnalysisRunSchema = z13.object({
|
|
|
11641
12013
|
designProjectRef: EntityRefSchema.optional(),
|
|
11642
12014
|
replayedFromRef: EntityRefSchema.optional(),
|
|
11643
12015
|
workflowDefinitionTeamId: ContractIdentifierSchema.optional(),
|
|
11644
|
-
workflowInput:
|
|
11645
|
-
createDesignProject:
|
|
11646
|
-
designProjectName:
|
|
12016
|
+
workflowInput: z14.record(z14.string(), JsonValueSchema).default({}),
|
|
12017
|
+
createDesignProject: z14.boolean().default(true),
|
|
12018
|
+
designProjectName: z14.string().trim().min(1).max(200).optional(),
|
|
11647
12019
|
modelRef: EntityRefSchema,
|
|
11648
12020
|
requestId: ContractIdentifierSchema,
|
|
11649
12021
|
idempotencyKey: ContractIdentifierSchema,
|
|
11650
|
-
status:
|
|
11651
|
-
outputRefs:
|
|
11652
|
-
error:
|
|
12022
|
+
status: z14.enum(["QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
|
|
12023
|
+
outputRefs: z14.array(EntityRefSchema).default([]),
|
|
12024
|
+
error: z14.object({
|
|
11653
12025
|
code: ContractIdentifierSchema,
|
|
11654
|
-
message:
|
|
11655
|
-
retryable:
|
|
12026
|
+
message: z14.string().trim().min(1),
|
|
12027
|
+
retryable: z14.boolean()
|
|
11656
12028
|
}).strict().optional(),
|
|
11657
12029
|
startedAt: IsoDateTimeSchema.optional(),
|
|
11658
12030
|
completedAt: IsoDateTimeSchema.optional(),
|
|
11659
12031
|
createdAt: IsoDateTimeSchema
|
|
11660
12032
|
}).strict();
|
|
11661
|
-
var RadarAnalysisAssetSchema =
|
|
12033
|
+
var RadarAnalysisAssetSchema = z14.object({
|
|
11662
12034
|
artifactRef: EntityRefSchema,
|
|
11663
12035
|
kind: ContractIdentifierSchema,
|
|
11664
|
-
mimeType:
|
|
11665
|
-
url:
|
|
11666
|
-
metadata:
|
|
12036
|
+
mimeType: z14.string().trim().min(1).optional(),
|
|
12037
|
+
url: z14.string().url(),
|
|
12038
|
+
metadata: z14.record(z14.string(), JsonValueSchema).default({}),
|
|
11667
12039
|
createdAt: IsoDateTimeSchema
|
|
11668
12040
|
}).strict();
|
|
11669
|
-
var RadarAnalysisDetailSchema =
|
|
11670
|
-
contract:
|
|
12041
|
+
var RadarAnalysisDetailSchema = z14.object({
|
|
12042
|
+
contract: z14.literal("RadarAnalysisDetail"),
|
|
11671
12043
|
run: RadarAnalysisRunSchema,
|
|
11672
|
-
runVersion:
|
|
12044
|
+
runVersion: z14.number().int().positive(),
|
|
11673
12045
|
selection: RadarSelectionSchema,
|
|
11674
|
-
outputs:
|
|
11675
|
-
assets:
|
|
11676
|
-
lineage:
|
|
12046
|
+
outputs: z14.array(OutputRecordSchema),
|
|
12047
|
+
assets: z14.array(RadarAnalysisAssetSchema),
|
|
12048
|
+
lineage: z14.array(LineageRecordSchema)
|
|
11677
12049
|
}).strict();
|
|
11678
|
-
var RadarActionRecordSchema =
|
|
11679
|
-
contract:
|
|
12050
|
+
var RadarActionRecordSchema = z14.object({
|
|
12051
|
+
contract: z14.literal("RadarActionRecord"),
|
|
11680
12052
|
actionId: ContractIdentifierSchema,
|
|
11681
12053
|
teamId: ContractIdentifierSchema,
|
|
11682
12054
|
actorRef: EntityRefSchema,
|
|
11683
|
-
action:
|
|
12055
|
+
action: z14.enum(["stash", "select", "reject", "archive", "launch", "retry", "replay", "rollback"]),
|
|
11684
12056
|
targetRef: EntityRefSchema,
|
|
11685
12057
|
requestId: ContractIdentifierSchema,
|
|
11686
12058
|
idempotencyKey: ContractIdentifierSchema,
|
|
11687
|
-
expectedVersion:
|
|
12059
|
+
expectedVersion: z14.number().int().nonnegative(),
|
|
11688
12060
|
occurredAt: IsoDateTimeSchema
|
|
11689
12061
|
}).strict();
|
|
11690
|
-
var RadarWritebackRecordSchema =
|
|
11691
|
-
contract:
|
|
12062
|
+
var RadarWritebackRecordSchema = z14.object({
|
|
12063
|
+
contract: z14.literal("RadarWritebackRecord"),
|
|
11692
12064
|
writebackId: ContractIdentifierSchema,
|
|
11693
12065
|
actionRef: EntityRefSchema,
|
|
11694
12066
|
targetRef: EntityRefSchema,
|
|
11695
|
-
status:
|
|
11696
|
-
resultingVersion:
|
|
11697
|
-
error:
|
|
12067
|
+
status: z14.enum(["PENDING", "APPLIED", "FAILED"]),
|
|
12068
|
+
resultingVersion: z14.number().int().nonnegative().optional(),
|
|
12069
|
+
error: z14.string().trim().min(1).optional(),
|
|
11698
12070
|
recordedAt: IsoDateTimeSchema
|
|
11699
12071
|
}).strict();
|
|
11700
12072
|
|
|
11701
12073
|
// src/contracts/workflow-definition.ts
|
|
11702
|
-
import { z as
|
|
11703
|
-
var ConductorTaskTypeSchema =
|
|
12074
|
+
import { z as z15 } from "zod";
|
|
12075
|
+
var ConductorTaskTypeSchema = z15.enum([
|
|
11704
12076
|
"SIMPLE",
|
|
11705
12077
|
"DYNAMIC",
|
|
11706
12078
|
"FORK_JOIN",
|
|
@@ -11749,46 +12121,46 @@ var requiredTaskFields = {
|
|
|
11749
12121
|
WAIT: ["inputParameters"],
|
|
11750
12122
|
TERMINATE: ["inputParameters"]
|
|
11751
12123
|
};
|
|
11752
|
-
var ConductorTaskDefinitionSchema =
|
|
11753
|
-
() =>
|
|
12124
|
+
var ConductorTaskDefinitionSchema = z15.lazy(
|
|
12125
|
+
() => z15.object({
|
|
11754
12126
|
name: ContractIdentifierSchema,
|
|
11755
12127
|
taskReferenceName: ContractIdentifierSchema,
|
|
11756
12128
|
type: ConductorTaskTypeSchema,
|
|
11757
|
-
inputParameters:
|
|
11758
|
-
startDelay:
|
|
11759
|
-
optional:
|
|
11760
|
-
asyncComplete:
|
|
11761
|
-
rateLimited:
|
|
11762
|
-
retryCount:
|
|
11763
|
-
taskDefinition:
|
|
11764
|
-
loopCondition:
|
|
11765
|
-
loopOver:
|
|
11766
|
-
sink:
|
|
11767
|
-
forkTasks:
|
|
11768
|
-
joinOn:
|
|
11769
|
-
defaultExclusiveJoinTask:
|
|
11770
|
-
dynamicForkTasksParam:
|
|
11771
|
-
dynamicForkTasksInputParamName:
|
|
11772
|
-
subWorkflowParam:
|
|
11773
|
-
$ref:
|
|
12129
|
+
inputParameters: z15.record(z15.string(), JsonValueSchema).optional(),
|
|
12130
|
+
startDelay: z15.number().int().nonnegative().optional(),
|
|
12131
|
+
optional: z15.boolean().optional(),
|
|
12132
|
+
asyncComplete: z15.boolean().optional(),
|
|
12133
|
+
rateLimited: z15.boolean().optional(),
|
|
12134
|
+
retryCount: z15.number().int().nonnegative().optional(),
|
|
12135
|
+
taskDefinition: z15.record(z15.string(), JsonValueSchema).optional(),
|
|
12136
|
+
loopCondition: z15.string().optional(),
|
|
12137
|
+
loopOver: z15.array(ConductorTaskDefinitionSchema).optional(),
|
|
12138
|
+
sink: z15.string().optional(),
|
|
12139
|
+
forkTasks: z15.array(z15.array(ConductorTaskDefinitionSchema)).optional(),
|
|
12140
|
+
joinOn: z15.array(ContractIdentifierSchema).optional(),
|
|
12141
|
+
defaultExclusiveJoinTask: z15.array(ContractIdentifierSchema).optional(),
|
|
12142
|
+
dynamicForkTasksParam: z15.string().optional(),
|
|
12143
|
+
dynamicForkTasksInputParamName: z15.string().optional(),
|
|
12144
|
+
subWorkflowParam: z15.object({
|
|
12145
|
+
$ref: z15.string().optional(),
|
|
11774
12146
|
name: ContractIdentifierSchema,
|
|
11775
|
-
version:
|
|
11776
|
-
taskToDomain:
|
|
11777
|
-
workflowDefinition:
|
|
12147
|
+
version: z15.number().int().positive().optional(),
|
|
12148
|
+
taskToDomain: z15.record(z15.string(), z15.string()).optional(),
|
|
12149
|
+
workflowDefinition: z15.record(z15.string(), JsonValueSchema).optional()
|
|
11778
12150
|
}).strict().optional(),
|
|
11779
|
-
decisionCases:
|
|
11780
|
-
defaultCase:
|
|
11781
|
-
evaluatorType:
|
|
11782
|
-
expression:
|
|
12151
|
+
decisionCases: z15.record(z15.string(), z15.array(ConductorTaskDefinitionSchema)).optional(),
|
|
12152
|
+
defaultCase: z15.array(ConductorTaskDefinitionSchema).optional(),
|
|
12153
|
+
evaluatorType: z15.enum(["value-param", "javascript", "graaljs"]).optional(),
|
|
12154
|
+
expression: z15.string().optional(),
|
|
11783
12155
|
__alias: JsonValueSchema.optional(),
|
|
11784
|
-
callbackFromWorker:
|
|
12156
|
+
callbackFromWorker: z15.boolean().optional(),
|
|
11785
12157
|
caseExpression: JsonValueSchema.optional(),
|
|
11786
|
-
caseValueParam:
|
|
11787
|
-
dependencies:
|
|
11788
|
-
description:
|
|
11789
|
-
dynamicTaskNameParam:
|
|
11790
|
-
joinMode:
|
|
11791
|
-
permissive:
|
|
12158
|
+
caseValueParam: z15.string().optional(),
|
|
12159
|
+
dependencies: z15.array(JsonValueSchema).optional(),
|
|
12160
|
+
description: z15.string().optional(),
|
|
12161
|
+
dynamicTaskNameParam: z15.string().optional(),
|
|
12162
|
+
joinMode: z15.string().optional(),
|
|
12163
|
+
permissive: z15.boolean().optional(),
|
|
11792
12164
|
joinTaskRef: ContractIdentifierSchema.optional(),
|
|
11793
12165
|
forkTaskRef: ContractIdentifierSchema.optional()
|
|
11794
12166
|
}).strict().superRefine((task, context) => {
|
|
@@ -11802,29 +12174,29 @@ var ConductorTaskDefinitionSchema = z14.lazy(
|
|
|
11802
12174
|
}
|
|
11803
12175
|
})
|
|
11804
12176
|
);
|
|
11805
|
-
var ConductorWorkflowDefinitionSchema =
|
|
11806
|
-
ownerApp:
|
|
11807
|
-
createTime:
|
|
11808
|
-
updateTime:
|
|
11809
|
-
createdBy:
|
|
11810
|
-
updatedBy:
|
|
12177
|
+
var ConductorWorkflowDefinitionSchema = z15.object({
|
|
12178
|
+
ownerApp: z15.string().optional(),
|
|
12179
|
+
createTime: z15.number().int().nonnegative().optional(),
|
|
12180
|
+
updateTime: z15.number().int().nonnegative().optional(),
|
|
12181
|
+
createdBy: z15.string().optional(),
|
|
12182
|
+
updatedBy: z15.string().optional(),
|
|
11811
12183
|
name: ContractIdentifierSchema,
|
|
11812
|
-
description:
|
|
11813
|
-
version:
|
|
11814
|
-
tasks:
|
|
11815
|
-
inputParameters:
|
|
11816
|
-
outputParameters:
|
|
12184
|
+
description: z15.string().optional(),
|
|
12185
|
+
version: z15.number().int().positive(),
|
|
12186
|
+
tasks: z15.array(ConductorTaskDefinitionSchema),
|
|
12187
|
+
inputParameters: z15.array(ContractIdentifierSchema),
|
|
12188
|
+
outputParameters: z15.record(z15.string(), JsonValueSchema).optional(),
|
|
11817
12189
|
failureWorkflow: ContractIdentifierSchema.optional(),
|
|
11818
|
-
schemaVersion:
|
|
11819
|
-
restartable:
|
|
11820
|
-
workflowStatusListenerEnabled:
|
|
11821
|
-
ownerEmail:
|
|
11822
|
-
timeoutPolicy:
|
|
11823
|
-
timeoutSeconds:
|
|
11824
|
-
variables:
|
|
11825
|
-
inputTemplate:
|
|
11826
|
-
}).strict();
|
|
11827
|
-
var WorkflowParameterTypeSchema =
|
|
12190
|
+
schemaVersion: z15.number().int().positive().optional(),
|
|
12191
|
+
restartable: z15.boolean().optional(),
|
|
12192
|
+
workflowStatusListenerEnabled: z15.boolean().optional(),
|
|
12193
|
+
ownerEmail: z15.string().email().optional(),
|
|
12194
|
+
timeoutPolicy: z15.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
|
|
12195
|
+
timeoutSeconds: z15.number().int().nonnegative(),
|
|
12196
|
+
variables: z15.record(z15.string(), JsonValueSchema).optional(),
|
|
12197
|
+
inputTemplate: z15.record(z15.string(), JsonValueSchema).optional()
|
|
12198
|
+
}).strict();
|
|
12199
|
+
var WorkflowParameterTypeSchema = z15.enum([
|
|
11828
12200
|
"string",
|
|
11829
12201
|
"file",
|
|
11830
12202
|
"number",
|
|
@@ -11834,213 +12206,213 @@ var WorkflowParameterTypeSchema = z14.enum([
|
|
|
11834
12206
|
"notice",
|
|
11835
12207
|
"canvas-assist"
|
|
11836
12208
|
]);
|
|
11837
|
-
var WorkflowConditionalStateSchema =
|
|
11838
|
-
conditions:
|
|
11839
|
-
|
|
11840
|
-
field:
|
|
11841
|
-
operator:
|
|
12209
|
+
var WorkflowConditionalStateSchema = z15.object({
|
|
12210
|
+
conditions: z15.array(
|
|
12211
|
+
z15.object({
|
|
12212
|
+
field: z15.string(),
|
|
12213
|
+
operator: z15.enum(["is", "isNot", "isGreaterThan", "isLessThan", "isGreaterThanOrEqual", "isLessThanOrEqual", "in", "notIn"]),
|
|
11842
12214
|
value: JsonValueSchema
|
|
11843
12215
|
}).strict()
|
|
11844
12216
|
),
|
|
11845
|
-
logic:
|
|
11846
|
-
}).strict();
|
|
11847
|
-
var ImageSelectMappingAppearanceSchema =
|
|
11848
|
-
columns:
|
|
11849
|
-
cardSize:
|
|
11850
|
-
imageAspectRatio:
|
|
11851
|
-
gap:
|
|
11852
|
-
radius:
|
|
11853
|
-
borderStyle:
|
|
11854
|
-
borderWidth:
|
|
11855
|
-
enableScroll:
|
|
11856
|
-
maxHeight:
|
|
11857
|
-
enableCollapse:
|
|
11858
|
-
visibleRows:
|
|
11859
|
-
hideLabel:
|
|
11860
|
-
hideDescription:
|
|
11861
|
-
hideValue:
|
|
11862
|
-
}).strict();
|
|
11863
|
-
var ComfyWorkflowPortBindingSchema =
|
|
11864
|
-
node:
|
|
11865
|
-
key:
|
|
11866
|
-
}).strict();
|
|
11867
|
-
var WorkflowParameterTypeOptionsSchema =
|
|
11868
|
-
editor:
|
|
11869
|
-
editorLanguage:
|
|
11870
|
-
maxValue:
|
|
11871
|
-
minValue:
|
|
11872
|
-
max:
|
|
11873
|
-
min:
|
|
11874
|
-
multipleValues:
|
|
11875
|
-
numberPrecision:
|
|
11876
|
-
password:
|
|
11877
|
-
rows:
|
|
11878
|
-
assetType:
|
|
11879
|
-
accept:
|
|
11880
|
-
maxSize:
|
|
11881
|
-
fileType:
|
|
11882
|
-
aiMultiShotMainImageField:
|
|
11883
|
-
aiMultiShotWorkflowAppId:
|
|
11884
|
-
aiMultiShotWorkflowId:
|
|
11885
|
-
allowCustomInput:
|
|
11886
|
-
allowUploadVideo:
|
|
11887
|
-
aspectRatioField:
|
|
11888
|
-
assemblyValueType:
|
|
11889
|
-
autoAnalyzeDesignImage:
|
|
11890
|
-
autoDetectAspectRatio:
|
|
11891
|
-
autoIncrementId:
|
|
12217
|
+
logic: z15.enum(["AND", "OR"]).optional()
|
|
12218
|
+
}).strict();
|
|
12219
|
+
var ImageSelectMappingAppearanceSchema = z15.object({
|
|
12220
|
+
columns: z15.number().int().min(1).max(4).optional(),
|
|
12221
|
+
cardSize: z15.enum(["sm", "md", "lg"]).optional(),
|
|
12222
|
+
imageAspectRatio: z15.enum(["square", "4:5", "3:4", "16:9"]).optional(),
|
|
12223
|
+
gap: z15.enum(["sm", "md", "lg"]).optional(),
|
|
12224
|
+
radius: z15.enum(["sm", "md", "lg", "xl"]).optional(),
|
|
12225
|
+
borderStyle: z15.enum(["none", "soft", "strong"]).optional(),
|
|
12226
|
+
borderWidth: z15.union([z15.literal(0), z15.literal(1), z15.literal(2)]).optional(),
|
|
12227
|
+
enableScroll: z15.boolean().optional(),
|
|
12228
|
+
maxHeight: z15.number().int().min(160).max(1200).optional(),
|
|
12229
|
+
enableCollapse: z15.boolean().optional(),
|
|
12230
|
+
visibleRows: z15.number().int().min(1).max(6).optional(),
|
|
12231
|
+
hideLabel: z15.boolean().optional(),
|
|
12232
|
+
hideDescription: z15.boolean().optional(),
|
|
12233
|
+
hideValue: z15.boolean().optional()
|
|
12234
|
+
}).strict();
|
|
12235
|
+
var ComfyWorkflowPortBindingSchema = z15.object({
|
|
12236
|
+
node: z15.union([z15.string(), z15.number()]),
|
|
12237
|
+
key: z15.string().optional()
|
|
12238
|
+
}).strict();
|
|
12239
|
+
var WorkflowParameterTypeOptionsSchema = z15.object({
|
|
12240
|
+
editor: z15.enum(["code", "codeNodeEditor", "htmlEditor", "sqlEditor", "json"]).optional(),
|
|
12241
|
+
editorLanguage: z15.enum(["javaScript", "json", "python", "sql"]).optional(),
|
|
12242
|
+
maxValue: z15.number().optional(),
|
|
12243
|
+
minValue: z15.number().optional(),
|
|
12244
|
+
max: z15.number().optional(),
|
|
12245
|
+
min: z15.number().optional(),
|
|
12246
|
+
multipleValues: z15.boolean().optional(),
|
|
12247
|
+
numberPrecision: z15.number().nonnegative().optional(),
|
|
12248
|
+
password: z15.boolean().optional(),
|
|
12249
|
+
rows: z15.number().int().positive().optional(),
|
|
12250
|
+
assetType: z15.string().optional(),
|
|
12251
|
+
accept: z15.string().optional(),
|
|
12252
|
+
maxSize: z15.number().positive().optional(),
|
|
12253
|
+
fileType: z15.string().optional(),
|
|
12254
|
+
aiMultiShotMainImageField: z15.string().optional(),
|
|
12255
|
+
aiMultiShotWorkflowAppId: z15.string().optional(),
|
|
12256
|
+
aiMultiShotWorkflowId: z15.string().optional(),
|
|
12257
|
+
allowCustomInput: z15.boolean().optional(),
|
|
12258
|
+
allowUploadVideo: z15.boolean().optional(),
|
|
12259
|
+
aspectRatioField: z15.string().optional(),
|
|
12260
|
+
assemblyValueType: z15.string().optional(),
|
|
12261
|
+
autoAnalyzeDesignImage: z15.boolean().optional(),
|
|
12262
|
+
autoDetectAspectRatio: z15.boolean().optional(),
|
|
12263
|
+
autoIncrementId: z15.boolean().optional(),
|
|
11892
12264
|
comfyOptions: ComfyWorkflowPortBindingSchema.optional(),
|
|
11893
|
-
comfyuiModelServerId:
|
|
11894
|
-
comfyuiModelTypeName:
|
|
12265
|
+
comfyuiModelServerId: z15.string().optional(),
|
|
12266
|
+
comfyuiModelTypeName: z15.string().optional(),
|
|
11895
12267
|
defaultCustomInput: JsonValueSchema.optional(),
|
|
11896
|
-
descriptionAlert:
|
|
11897
|
-
disabled:
|
|
11898
|
-
editable:
|
|
11899
|
-
enableAiMultiShot:
|
|
11900
|
-
enableBooleanSwitchMode:
|
|
11901
|
-
enableClear:
|
|
11902
|
-
enableExpand:
|
|
11903
|
-
enableImageMask:
|
|
11904
|
-
enableImageOverlay:
|
|
11905
|
-
enablePopupEditor:
|
|
11906
|
-
enablePromptFontSize:
|
|
11907
|
-
enableReset:
|
|
11908
|
-
enableSelectItemIcon:
|
|
11909
|
-
enableSelectList:
|
|
11910
|
-
enableSelectSearch:
|
|
11911
|
-
enableSliderEnterMode:
|
|
11912
|
-
enableVoice:
|
|
11913
|
-
expandButtonText:
|
|
11914
|
-
foldUp:
|
|
11915
|
-
hidden:
|
|
11916
|
-
hideRequiredDot:
|
|
11917
|
-
inlineTitleWithSelect:
|
|
11918
|
-
knowledgeGraphButtonText:
|
|
11919
|
-
identifyAttributeCount:
|
|
11920
|
-
identifyAttributes:
|
|
11921
|
-
identifyMaxVariants:
|
|
11922
|
-
identifySourceField:
|
|
11923
|
-
imageOverlayBaseField:
|
|
11924
|
-
imageOverlayOverlayField:
|
|
12268
|
+
descriptionAlert: z15.boolean().optional(),
|
|
12269
|
+
disabled: z15.union([z15.boolean(), WorkflowConditionalStateSchema]).optional(),
|
|
12270
|
+
editable: z15.union([z15.boolean(), WorkflowConditionalStateSchema]).optional(),
|
|
12271
|
+
enableAiMultiShot: z15.boolean().optional(),
|
|
12272
|
+
enableBooleanSwitchMode: z15.boolean().optional(),
|
|
12273
|
+
enableClear: z15.boolean().optional(),
|
|
12274
|
+
enableExpand: z15.boolean().optional(),
|
|
12275
|
+
enableImageMask: z15.boolean().optional(),
|
|
12276
|
+
enableImageOverlay: z15.boolean().optional(),
|
|
12277
|
+
enablePopupEditor: z15.boolean().optional(),
|
|
12278
|
+
enablePromptFontSize: z15.boolean().optional(),
|
|
12279
|
+
enableReset: z15.boolean().optional(),
|
|
12280
|
+
enableSelectItemIcon: z15.boolean().optional(),
|
|
12281
|
+
enableSelectList: z15.boolean().optional(),
|
|
12282
|
+
enableSelectSearch: z15.boolean().optional(),
|
|
12283
|
+
enableSliderEnterMode: z15.boolean().optional(),
|
|
12284
|
+
enableVoice: z15.boolean().optional(),
|
|
12285
|
+
expandButtonText: z15.string().optional(),
|
|
12286
|
+
foldUp: z15.boolean().optional(),
|
|
12287
|
+
hidden: z15.boolean().optional(),
|
|
12288
|
+
hideRequiredDot: z15.boolean().optional(),
|
|
12289
|
+
inlineTitleWithSelect: z15.boolean().optional(),
|
|
12290
|
+
knowledgeGraphButtonText: z15.string().optional(),
|
|
12291
|
+
identifyAttributeCount: z15.union([z15.number().nonnegative(), z15.string().min(1), z15.object({ min: z15.number().nonnegative().optional(), max: z15.number().nonnegative().optional() }).strict()]).optional(),
|
|
12292
|
+
identifyAttributes: z15.array(JsonValueSchema).optional(),
|
|
12293
|
+
identifyMaxVariants: z15.number().int().nonnegative().optional(),
|
|
12294
|
+
identifySourceField: z15.string().optional(),
|
|
12295
|
+
imageOverlayBaseField: z15.string().optional(),
|
|
12296
|
+
imageOverlayOverlayField: z15.string().optional(),
|
|
11925
12297
|
imageSelectMappingAppearance: ImageSelectMappingAppearanceSchema.optional(),
|
|
11926
|
-
imageSelectMappingColumns:
|
|
11927
|
-
imageSelectMappingEnableCustomUpload:
|
|
11928
|
-
imageSelectMappingHideLabel:
|
|
11929
|
-
imageSelectMappingHideLink:
|
|
11930
|
-
imageSelectMappingHideMeta:
|
|
11931
|
-
imageSelectMappingInlineUseLargeUploadBox:
|
|
11932
|
-
imageSelectMappingPromptField:
|
|
11933
|
-
imageSelectMappingTabOrder:
|
|
11934
|
-
imageSelectMappingTabWidthMode:
|
|
12298
|
+
imageSelectMappingColumns: z15.number().int().min(1).max(4).optional(),
|
|
12299
|
+
imageSelectMappingEnableCustomUpload: z15.boolean().optional(),
|
|
12300
|
+
imageSelectMappingHideLabel: z15.boolean().optional(),
|
|
12301
|
+
imageSelectMappingHideLink: z15.boolean().optional(),
|
|
12302
|
+
imageSelectMappingHideMeta: z15.boolean().optional(),
|
|
12303
|
+
imageSelectMappingInlineUseLargeUploadBox: z15.boolean().optional(),
|
|
12304
|
+
imageSelectMappingPromptField: z15.string().optional(),
|
|
12305
|
+
imageSelectMappingTabOrder: z15.enum(["template-first", "upload-first"]).optional(),
|
|
12306
|
+
imageSelectMappingTabWidthMode: z15.enum(["content", "fill"]).optional(),
|
|
11935
12307
|
imageSelectMappingTemplatePrompt: LocalizedTextSchema.optional(),
|
|
11936
12308
|
imageSelectMappingTemplateTabTitle: LocalizedTextSchema.optional(),
|
|
11937
|
-
imageSelectMappingUploadMode:
|
|
12309
|
+
imageSelectMappingUploadMode: z15.enum(["tabs", "inline"]).optional(),
|
|
11938
12310
|
imageSelectMappingUploadPrompt: LocalizedTextSchema.optional(),
|
|
11939
12311
|
imageSelectMappingUploadTabTitle: LocalizedTextSchema.optional(),
|
|
11940
|
-
endpoints:
|
|
11941
|
-
examples:
|
|
12312
|
+
endpoints: z15.array(JsonValueSchema).optional(),
|
|
12313
|
+
examples: z15.array(JsonValueSchema).optional(),
|
|
11942
12314
|
extraData: JsonValueSchema.optional(),
|
|
11943
12315
|
layer: JsonValueSchema.optional(),
|
|
11944
12316
|
map: JsonValueSchema.optional(),
|
|
11945
|
-
multiline:
|
|
11946
|
-
options:
|
|
11947
|
-
originalFiles:
|
|
12317
|
+
multiline: z15.boolean().optional(),
|
|
12318
|
+
options: z15.array(JsonValueSchema).optional(),
|
|
12319
|
+
originalFiles: z15.array(JsonValueSchema).optional(),
|
|
11948
12320
|
placeholder: LocalizedTextSchema.optional(),
|
|
11949
|
-
preserveSelectListOrder:
|
|
12321
|
+
preserveSelectListOrder: z15.boolean().optional(),
|
|
11950
12322
|
promptDictionary: JsonValueSchema.optional(),
|
|
11951
|
-
promptFontSize:
|
|
12323
|
+
promptFontSize: z15.number().optional(),
|
|
11952
12324
|
promptModeToggle: JsonValueSchema.optional(),
|
|
11953
|
-
requireActiveSelectFilter:
|
|
11954
|
-
restoreDefaultOnEmptyEnter:
|
|
11955
|
-
search:
|
|
11956
|
-
selectButtonEnableCollapse:
|
|
11957
|
-
selectButtonVisibleRows:
|
|
11958
|
-
selectList:
|
|
11959
|
-
selectListDisplayMode:
|
|
11960
|
-
selectPromptField:
|
|
11961
|
-
showAddLocalFileButton:
|
|
11962
|
-
singleColumn:
|
|
11963
|
-
singleFrameForMultiple:
|
|
11964
|
-
textSingleLine:
|
|
11965
|
-
textareaMiniHeight:
|
|
12325
|
+
requireActiveSelectFilter: z15.boolean().optional(),
|
|
12326
|
+
restoreDefaultOnEmptyEnter: z15.boolean().optional(),
|
|
12327
|
+
search: z15.boolean().optional(),
|
|
12328
|
+
selectButtonEnableCollapse: z15.boolean().optional(),
|
|
12329
|
+
selectButtonVisibleRows: z15.number().int().positive().optional(),
|
|
12330
|
+
selectList: z15.array(JsonValueSchema).optional(),
|
|
12331
|
+
selectListDisplayMode: z15.string().optional(),
|
|
12332
|
+
selectPromptField: z15.string().optional(),
|
|
12333
|
+
showAddLocalFileButton: z15.boolean().optional(),
|
|
12334
|
+
singleColumn: z15.boolean().optional(),
|
|
12335
|
+
singleFrameForMultiple: z15.boolean().optional(),
|
|
12336
|
+
textSingleLine: z15.boolean().optional(),
|
|
12337
|
+
textareaMiniHeight: z15.number().nonnegative().optional(),
|
|
11966
12338
|
tips: LocalizedTextSchema.optional(),
|
|
11967
12339
|
visibility: JsonValueSchema.optional(),
|
|
11968
|
-
voiceButtonText:
|
|
11969
|
-
designAnalysisFields:
|
|
11970
|
-
designAnalysisFillStrategy:
|
|
11971
|
-
designAnalysisMaxFields:
|
|
11972
|
-
designAnalysisType:
|
|
11973
|
-
designAnalysisFieldPrefix:
|
|
11974
|
-
}).strict();
|
|
11975
|
-
var WorkflowParameterSchema =
|
|
11976
|
-
() =>
|
|
12340
|
+
voiceButtonText: z15.string().optional(),
|
|
12341
|
+
designAnalysisFields: z15.array(JsonValueSchema).optional(),
|
|
12342
|
+
designAnalysisFillStrategy: z15.string().optional(),
|
|
12343
|
+
designAnalysisMaxFields: z15.number().int().nonnegative().optional(),
|
|
12344
|
+
designAnalysisType: z15.string().optional(),
|
|
12345
|
+
designAnalysisFieldPrefix: z15.string().optional()
|
|
12346
|
+
}).strict();
|
|
12347
|
+
var WorkflowParameterSchema = z15.lazy(
|
|
12348
|
+
() => z15.object({
|
|
11977
12349
|
displayName: LocalizedTextSchema,
|
|
11978
12350
|
name: ContractIdentifierSchema,
|
|
11979
12351
|
type: WorkflowParameterTypeSchema,
|
|
11980
12352
|
typeOptions: WorkflowParameterTypeOptionsSchema.optional(),
|
|
11981
12353
|
default: JsonValueSchema.optional(),
|
|
11982
12354
|
description: LocalizedTextSchema.optional(),
|
|
11983
|
-
hint:
|
|
11984
|
-
displayOptions:
|
|
11985
|
-
hide:
|
|
11986
|
-
show:
|
|
12355
|
+
hint: z15.string().optional(),
|
|
12356
|
+
displayOptions: z15.object({
|
|
12357
|
+
hide: z15.record(z15.string(), z15.array(JsonValueSchema)).optional(),
|
|
12358
|
+
show: z15.record(z15.string(), z15.array(JsonValueSchema)).optional()
|
|
11987
12359
|
}).strict().optional(),
|
|
11988
|
-
options:
|
|
11989
|
-
|
|
12360
|
+
options: z15.array(z15.union([
|
|
12361
|
+
z15.object({ name: LocalizedTextSchema, value: z15.union([z15.string(), z15.number(), z15.boolean()]), action: z15.string().optional(), description: LocalizedTextSchema.optional() }).strict(),
|
|
11990
12362
|
WorkflowParameterSchema,
|
|
11991
|
-
|
|
12363
|
+
z15.object({ displayName: z15.string(), name: ContractIdentifierSchema, values: z15.array(WorkflowParameterSchema) }).strict()
|
|
11992
12364
|
])).optional(),
|
|
11993
12365
|
placeholder: LocalizedTextSchema.optional(),
|
|
11994
|
-
isNodeSetting:
|
|
11995
|
-
noDataExpression:
|
|
11996
|
-
required:
|
|
11997
|
-
example:
|
|
11998
|
-
extractValue:
|
|
11999
|
-
properties:
|
|
12000
|
-
assetType:
|
|
12001
|
-
flag:
|
|
12002
|
-
enableExpand:
|
|
12003
|
-
enableVoice:
|
|
12004
|
-
expandButtonText:
|
|
12005
|
-
knowledgeGraphButtonText:
|
|
12006
|
-
selectListDisplayMode:
|
|
12007
|
-
voiceButtonText:
|
|
12366
|
+
isNodeSetting: z15.boolean().optional(),
|
|
12367
|
+
noDataExpression: z15.boolean().optional(),
|
|
12368
|
+
required: z15.boolean().optional(),
|
|
12369
|
+
example: z15.string().optional(),
|
|
12370
|
+
extractValue: z15.object({ type: z15.literal("regex"), regex: z15.string() }).strict().optional(),
|
|
12371
|
+
properties: z15.array(WorkflowParameterSchema).optional(),
|
|
12372
|
+
assetType: z15.string().optional(),
|
|
12373
|
+
flag: z15.boolean().optional(),
|
|
12374
|
+
enableExpand: z15.boolean().optional(),
|
|
12375
|
+
enableVoice: z15.boolean().optional(),
|
|
12376
|
+
expandButtonText: z15.string().optional(),
|
|
12377
|
+
knowledgeGraphButtonText: z15.string().optional(),
|
|
12378
|
+
selectListDisplayMode: z15.string().optional(),
|
|
12379
|
+
voiceButtonText: z15.string().optional()
|
|
12008
12380
|
}).strict()
|
|
12009
12381
|
);
|
|
12010
|
-
var WorkflowOutputBindingSchema =
|
|
12011
|
-
var WorkflowNodeSchema =
|
|
12382
|
+
var WorkflowOutputBindingSchema = z15.object({ key: ContractIdentifierSchema, value: z15.string() }).strict();
|
|
12383
|
+
var WorkflowNodeSchema = z15.object({
|
|
12012
12384
|
id: ContractIdentifierSchema,
|
|
12013
12385
|
referenceName: ContractIdentifierSchema,
|
|
12014
12386
|
capabilityRef: ContractIdentifierSchema,
|
|
12015
12387
|
capabilityVersion: ContractIdentifierSchema.optional(),
|
|
12016
|
-
inputBindings:
|
|
12017
|
-
configuration:
|
|
12388
|
+
inputBindings: z15.record(z15.string(), JsonValueSchema).default({}),
|
|
12389
|
+
configuration: z15.object({ executor: z15.literal("conductor"), task: ConductorTaskDefinitionSchema }).strict()
|
|
12018
12390
|
}).strict().superRefine((node, context) => {
|
|
12019
12391
|
if (node.configuration.task.taskReferenceName !== node.referenceName) context.addIssue({ code: "custom", path: ["configuration", "task", "taskReferenceName"], message: "Conductor task reference must match node referenceName." });
|
|
12020
12392
|
if (node.configuration.task.name !== node.capabilityRef) context.addIssue({ code: "custom", path: ["configuration", "task", "name"], message: "Conductor task name must match node capabilityRef." });
|
|
12021
12393
|
if (JSON.stringify(node.configuration.task.inputParameters ?? {}) !== JSON.stringify(node.inputBindings)) context.addIssue({ code: "custom", path: ["configuration", "task", "inputParameters"], message: "Conductor task inputs must match node inputBindings." });
|
|
12022
12394
|
});
|
|
12023
|
-
var WorkflowEdgeSchema =
|
|
12395
|
+
var WorkflowEdgeSchema = z15.object({
|
|
12024
12396
|
from: ContractIdentifierSchema,
|
|
12025
12397
|
to: ContractIdentifierSchema,
|
|
12026
12398
|
outputPort: ContractIdentifierSchema.optional(),
|
|
12027
12399
|
inputPort: ContractIdentifierSchema.optional(),
|
|
12028
|
-
condition:
|
|
12400
|
+
condition: z15.string().optional()
|
|
12029
12401
|
}).strict();
|
|
12030
|
-
var WorkflowTriggerSchema =
|
|
12402
|
+
var WorkflowTriggerSchema = z15.object({
|
|
12031
12403
|
id: ContractIdentifierSchema,
|
|
12032
|
-
type:
|
|
12033
|
-
enabled:
|
|
12034
|
-
schedule:
|
|
12035
|
-
webhook:
|
|
12036
|
-
path:
|
|
12037
|
-
method:
|
|
12038
|
-
auth:
|
|
12039
|
-
basicAuth:
|
|
12040
|
-
headerAuth:
|
|
12041
|
-
responseUntil:
|
|
12404
|
+
type: z15.enum(["manual", "schedule", "webhook", "event", "api"]),
|
|
12405
|
+
enabled: z15.boolean(),
|
|
12406
|
+
schedule: z15.object({ cron: z15.string().trim().min(1) }).strict().optional(),
|
|
12407
|
+
webhook: z15.object({
|
|
12408
|
+
path: z15.string().trim().min(1).optional(),
|
|
12409
|
+
method: z15.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]),
|
|
12410
|
+
auth: z15.enum(["NONE", "BASIC", "CUSTOM_HEADER"]),
|
|
12411
|
+
basicAuth: z15.object({ username: z15.string(), password: z15.string() }).strict().optional(),
|
|
12412
|
+
headerAuth: z15.object({ name: z15.string().trim().min(1), value: z15.string() }).strict().optional(),
|
|
12413
|
+
responseUntil: z15.enum(["WORKFLOW_STARTED", "WORKFLOW_COMPLETED_OR_FINISHED"])
|
|
12042
12414
|
}).strict().optional(),
|
|
12043
|
-
event:
|
|
12415
|
+
event: z15.object({
|
|
12044
12416
|
eventType: ContractIdentifierSchema,
|
|
12045
12417
|
configuration: JsonValueSchema.optional()
|
|
12046
12418
|
}).strict().optional()
|
|
@@ -12049,63 +12421,63 @@ var WorkflowTriggerSchema = z14.object({
|
|
|
12049
12421
|
if (trigger.type === "webhook" && !trigger.webhook) context.addIssue({ code: "custom", path: ["webhook"], message: "Webhook trigger requires webhook configuration." });
|
|
12050
12422
|
if (trigger.type === "event" && !trigger.event) context.addIssue({ code: "custom", path: ["event"], message: "Event trigger requires event configuration." });
|
|
12051
12423
|
});
|
|
12052
|
-
var WorkflowValidationIssueSchema =
|
|
12424
|
+
var WorkflowValidationIssueSchema = z15.object({
|
|
12053
12425
|
taskReferenceName: ContractIdentifierSchema,
|
|
12054
|
-
issueType:
|
|
12055
|
-
detailReason:
|
|
12056
|
-
humanMessage:
|
|
12426
|
+
issueType: z15.enum(["ERROR", "WARNING"]),
|
|
12427
|
+
detailReason: z15.object({ type: ContractIdentifierSchema, name: ContractIdentifierSchema, detailInformation: JsonValueSchema.optional() }).strict(),
|
|
12428
|
+
humanMessage: z15.object({ en: z15.string(), zh: z15.string() }).strict()
|
|
12057
12429
|
}).strict();
|
|
12058
|
-
var WorkflowDefinitionSchema =
|
|
12059
|
-
contract:
|
|
12430
|
+
var WorkflowDefinitionSchema = z15.object({
|
|
12431
|
+
contract: z15.literal("WorkflowDefinition"),
|
|
12060
12432
|
metadata: ContractMetadataSchema.omit({ name: true, description: true, labels: true }).extend({
|
|
12061
12433
|
name: LocalizedTextSchema,
|
|
12062
12434
|
description: LocalizedTextSchema.optional(),
|
|
12063
|
-
role:
|
|
12435
|
+
role: z15.enum(["workflow", "template"]),
|
|
12064
12436
|
teamId: ContractIdentifierSchema,
|
|
12065
12437
|
creatorRef: EntityRefSchema,
|
|
12066
|
-
tags:
|
|
12438
|
+
tags: z15.array(ContractIdentifierSchema).default([])
|
|
12067
12439
|
}).strict(),
|
|
12068
|
-
revision:
|
|
12069
|
-
kind:
|
|
12070
|
-
recordVersion:
|
|
12071
|
-
sourceVersion:
|
|
12440
|
+
revision: z15.object({
|
|
12441
|
+
kind: z15.enum(["release", "backup"]),
|
|
12442
|
+
recordVersion: z15.number().int().positive(),
|
|
12443
|
+
sourceVersion: z15.number().int().positive().optional()
|
|
12072
12444
|
}).strict().superRefine((revision, context) => {
|
|
12073
12445
|
if (revision.kind === "backup" && revision.sourceVersion === void 0) context.addIssue({ code: "custom", path: ["sourceVersion"], message: "Backup revisions require a sourceVersion." });
|
|
12074
12446
|
}),
|
|
12075
|
-
presentation:
|
|
12076
|
-
ports:
|
|
12077
|
-
parameters:
|
|
12078
|
-
graph:
|
|
12079
|
-
execution:
|
|
12080
|
-
timeoutMs:
|
|
12081
|
-
retries:
|
|
12082
|
-
concurrencyLimit:
|
|
12083
|
-
idempotency:
|
|
12084
|
-
rateLimit:
|
|
12447
|
+
presentation: z15.object({ iconUrl: z15.string().optional(), thumbnail: z15.string().optional() }).strict(),
|
|
12448
|
+
ports: z15.object({ inputs: z15.array(ContractPortSchema).default([]), outputs: z15.array(ContractPortSchema).default([]) }).strict(),
|
|
12449
|
+
parameters: z15.object({ variables: z15.array(WorkflowParameterSchema).default([]), outputs: z15.array(WorkflowOutputBindingSchema).default([]) }).strict(),
|
|
12450
|
+
graph: z15.object({ nodes: z15.array(WorkflowNodeSchema), edges: z15.array(WorkflowEdgeSchema).default([]) }).strict(),
|
|
12451
|
+
execution: z15.object({
|
|
12452
|
+
timeoutMs: z15.number().int().positive().optional(),
|
|
12453
|
+
retries: z15.number().int().nonnegative().default(0),
|
|
12454
|
+
concurrencyLimit: z15.number().int().positive().optional(),
|
|
12455
|
+
idempotency: z15.enum(["required", "supported", "none"]),
|
|
12456
|
+
rateLimit: z15.object({ enabled: z15.boolean(), max: z15.number().int().nonnegative(), windowMs: z15.number().int().nonnegative() }).strict().superRefine((rateLimit, context) => {
|
|
12085
12457
|
if (rateLimit.enabled && (rateLimit.max === 0 || rateLimit.windowMs === 0)) context.addIssue({ code: "custom", message: "Enabled rate limit requires positive max and windowMs." });
|
|
12086
12458
|
}).optional(),
|
|
12087
|
-
conductor:
|
|
12088
|
-
ownerApp:
|
|
12089
|
-
createTime:
|
|
12090
|
-
updateTime:
|
|
12091
|
-
createdBy:
|
|
12092
|
-
updatedBy:
|
|
12459
|
+
conductor: z15.object({
|
|
12460
|
+
ownerApp: z15.string().optional(),
|
|
12461
|
+
createTime: z15.number().int().nonnegative().optional(),
|
|
12462
|
+
updateTime: z15.number().int().nonnegative().optional(),
|
|
12463
|
+
createdBy: z15.string().optional(),
|
|
12464
|
+
updatedBy: z15.string().optional(),
|
|
12093
12465
|
failureWorkflow: ContractIdentifierSchema.optional(),
|
|
12094
|
-
schemaVersion:
|
|
12095
|
-
restartable:
|
|
12096
|
-
workflowStatusListenerEnabled:
|
|
12097
|
-
ownerEmail:
|
|
12098
|
-
timeoutPolicy:
|
|
12099
|
-
variables:
|
|
12100
|
-
inputTemplate:
|
|
12466
|
+
schemaVersion: z15.number().int().positive().optional(),
|
|
12467
|
+
restartable: z15.boolean().optional(),
|
|
12468
|
+
workflowStatusListenerEnabled: z15.boolean().optional(),
|
|
12469
|
+
ownerEmail: z15.string().email().optional(),
|
|
12470
|
+
timeoutPolicy: z15.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
|
|
12471
|
+
variables: z15.record(z15.string(), JsonValueSchema).optional(),
|
|
12472
|
+
inputTemplate: z15.record(z15.string(), JsonValueSchema).optional()
|
|
12101
12473
|
}).strict()
|
|
12102
12474
|
}).strict(),
|
|
12103
|
-
triggers:
|
|
12104
|
-
views:
|
|
12105
|
-
dataContracts:
|
|
12106
|
-
governance:
|
|
12107
|
-
interfaces:
|
|
12108
|
-
openai:
|
|
12475
|
+
triggers: z15.array(WorkflowTriggerSchema).default([]),
|
|
12476
|
+
views: z15.array(z15.object({ pageRef: ContractIdentifierSchema, placement: ContractIdentifierSchema.optional() }).strict()).default([]),
|
|
12477
|
+
dataContracts: z15.object({ reads: z15.array(ContractIdentifierSchema).default([]), writes: z15.array(ContractIdentifierSchema).default([]), emits: z15.array(ContractIdentifierSchema).default([]) }).strict(),
|
|
12478
|
+
governance: z15.object({ activated: z15.boolean(), validated: z15.boolean(), validationIssues: z15.array(WorkflowValidationIssueSchema).default([]), hidden: z15.boolean().optional() }).strict(),
|
|
12479
|
+
interfaces: z15.object({
|
|
12480
|
+
openai: z15.object({ enabled: z15.boolean(), modelName: z15.string().trim().min(1).optional() }).strict(),
|
|
12109
12481
|
shortcutRef: EntityRefSchema.optional(),
|
|
12110
12482
|
preferredAppId: ContractIdentifierSchema.optional()
|
|
12111
12483
|
}).strict().superRefine((interfaces, context) => {
|
|
@@ -12124,21 +12496,21 @@ var WorkflowDefinitionSchema = z14.object({
|
|
|
12124
12496
|
});
|
|
12125
12497
|
|
|
12126
12498
|
// src/contracts/workflow-runtime.ts
|
|
12127
|
-
import { z as
|
|
12128
|
-
var WorkflowCatalogEntrySchema =
|
|
12129
|
-
contract:
|
|
12499
|
+
import { z as z16 } from "zod";
|
|
12500
|
+
var WorkflowCatalogEntrySchema = z16.object({
|
|
12501
|
+
contract: z16.literal("WorkflowCatalogEntry"),
|
|
12130
12502
|
workflowId: ContractIdentifierSchema,
|
|
12131
12503
|
teamId: ContractIdentifierSchema,
|
|
12132
12504
|
creatorRef: EntityRefSchema,
|
|
12133
12505
|
currentDefinitionRef: EntityRefSchema,
|
|
12134
|
-
lifecycle:
|
|
12135
|
-
asset:
|
|
12136
|
-
preset:
|
|
12137
|
-
marketplacePublished:
|
|
12506
|
+
lifecycle: z16.enum(["ACTIVE", "DELETED"]),
|
|
12507
|
+
asset: z16.object({
|
|
12508
|
+
preset: z16.boolean(),
|
|
12509
|
+
marketplacePublished: z16.boolean(),
|
|
12138
12510
|
publishConfig: JsonObjectSchema.optional(),
|
|
12139
|
-
sort:
|
|
12511
|
+
sort: z16.number().int(),
|
|
12140
12512
|
forkFromRef: EntityRefSchema.optional(),
|
|
12141
|
-
notAuthorized:
|
|
12513
|
+
notAuthorized: z16.boolean()
|
|
12142
12514
|
}).strict(),
|
|
12143
12515
|
createdAt: IsoDateTimeSchema,
|
|
12144
12516
|
updatedAt: IsoDateTimeSchema,
|
|
@@ -12173,17 +12545,17 @@ var WorkflowCatalogEntrySchema = z15.object({
|
|
|
12173
12545
|
});
|
|
12174
12546
|
}
|
|
12175
12547
|
});
|
|
12176
|
-
var WorkflowPublicationSchema =
|
|
12177
|
-
contract:
|
|
12548
|
+
var WorkflowPublicationSchema = z16.object({
|
|
12549
|
+
contract: z16.literal("WorkflowPublication"),
|
|
12178
12550
|
publicationId: ContractIdentifierSchema,
|
|
12179
12551
|
definitionRef: EntityRefSchema,
|
|
12180
12552
|
runtimeDefinitionRef: EntityRefSchema,
|
|
12181
12553
|
sourceHash: Sha256Schema,
|
|
12182
12554
|
compiledHash: Sha256Schema,
|
|
12183
|
-
status:
|
|
12555
|
+
status: z16.enum(["PENDING", "PUBLISHED", "FAILED", "RETIRED"]),
|
|
12184
12556
|
publisherRef: EntityRefSchema,
|
|
12185
12557
|
publishedAt: IsoDateTimeSchema.optional(),
|
|
12186
|
-
failureReason:
|
|
12558
|
+
failureReason: z16.string().trim().min(1).optional()
|
|
12187
12559
|
}).strict().superRefine((publication, context) => {
|
|
12188
12560
|
if (publication.definitionRef.kind !== "workflow-definition") {
|
|
12189
12561
|
context.addIssue({
|
|
@@ -12214,12 +12586,12 @@ var WorkflowPublicationSchema = z15.object({
|
|
|
12214
12586
|
});
|
|
12215
12587
|
}
|
|
12216
12588
|
});
|
|
12217
|
-
var WorkflowCompletionCommitSchema =
|
|
12218
|
-
contract:
|
|
12589
|
+
var WorkflowCompletionCommitSchema = z16.object({
|
|
12590
|
+
contract: z16.literal("WorkflowCompletionCommit"),
|
|
12219
12591
|
commitId: ContractIdentifierSchema,
|
|
12220
12592
|
run: ApplicationRunSchema,
|
|
12221
|
-
outputs:
|
|
12222
|
-
artifacts:
|
|
12593
|
+
outputs: z16.array(OutputRecordSchema),
|
|
12594
|
+
artifacts: z16.array(ArtifactManifestSchema),
|
|
12223
12595
|
lineage: LineageRecordSchema,
|
|
12224
12596
|
completedAt: IsoDateTimeSchema
|
|
12225
12597
|
}).strict().superRefine((commit, context) => {
|
|
@@ -12261,15 +12633,15 @@ var WorkflowCompletionCommitSchema = z15.object({
|
|
|
12261
12633
|
}
|
|
12262
12634
|
});
|
|
12263
12635
|
});
|
|
12264
|
-
var WorkflowCompletionReceiptSchema =
|
|
12265
|
-
contract:
|
|
12636
|
+
var WorkflowCompletionReceiptSchema = z16.object({
|
|
12637
|
+
contract: z16.literal("WorkflowCompletionReceipt"),
|
|
12266
12638
|
commitId: ContractIdentifierSchema,
|
|
12267
12639
|
runRef: EntityRefSchema,
|
|
12268
|
-
outputRefs:
|
|
12269
|
-
artifactRefs:
|
|
12640
|
+
outputRefs: z16.array(EntityRefSchema),
|
|
12641
|
+
artifactRefs: z16.array(EntityRefSchema),
|
|
12270
12642
|
contentHash: Sha256Schema,
|
|
12271
12643
|
committedAt: IsoDateTimeSchema,
|
|
12272
|
-
idempotentReplay:
|
|
12644
|
+
idempotentReplay: z16.boolean()
|
|
12273
12645
|
}).strict().superRefine((receipt, context) => {
|
|
12274
12646
|
if (receipt.runRef.kind !== "application-run") {
|
|
12275
12647
|
context.addIssue({
|
|
@@ -12333,6 +12705,9 @@ var canonicalContractSchemas = {
|
|
|
12333
12705
|
"expiring-access-grant": ExpiringAccessGrantSchema,
|
|
12334
12706
|
"hotword-body": HotwordBodySchema,
|
|
12335
12707
|
"lineage-record": LineageRecordSchema,
|
|
12708
|
+
"menu-definition": MenuDefinitionSchema,
|
|
12709
|
+
"menu-definition-set": MenuDefinitionSetSchema,
|
|
12710
|
+
"menu-runtime-bundle": MenuRuntimeBundleSchema,
|
|
12336
12711
|
"ontology-definition": OntologyDefinitionSchema,
|
|
12337
12712
|
"overlay-node": OverlayNodeSchema,
|
|
12338
12713
|
"output-record": OutputRecordSchema,
|
|
@@ -12729,6 +13104,11 @@ var compileProductDeclaration = (input) => {
|
|
|
12729
13104
|
const commandsByName = uniqueIndex(declaration.commands, (value) => value.commandName, "command name");
|
|
12730
13105
|
const capabilitiesById = uniqueIndex(declaration.capabilities, (value) => value.id, "capability id");
|
|
12731
13106
|
const pagesById = uniqueIndex(declaration.pages, (value) => value.pageId, "page id");
|
|
13107
|
+
const menusByKey = uniqueIndex(
|
|
13108
|
+
declaration.menus,
|
|
13109
|
+
(value) => `${value.applicationId}/${value.surface}/${value.menuId}`,
|
|
13110
|
+
"menu definition"
|
|
13111
|
+
);
|
|
12732
13112
|
const nodes = [];
|
|
12733
13113
|
const edges = [];
|
|
12734
13114
|
const addNode = (kind, id) => nodes.push(ref(kind, id));
|
|
@@ -12743,6 +13123,7 @@ var compileProductDeclaration = (input) => {
|
|
|
12743
13123
|
}
|
|
12744
13124
|
for (const command of declaration.commands) addNode("command", command.commandName);
|
|
12745
13125
|
for (const capability of declaration.capabilities) addNode("capability", capability.id);
|
|
13126
|
+
for (const menu of declaration.menus) addNode("menu", `${menu.applicationId}/${menu.surface}/${menu.menuId}`);
|
|
12746
13127
|
for (const concept of declaration.concepts) {
|
|
12747
13128
|
addNode("concept", concept.conceptId);
|
|
12748
13129
|
if (concept.ontologyId) {
|
|
@@ -12788,6 +13169,7 @@ var compileProductDeclaration = (input) => {
|
|
|
12788
13169
|
commandsByName,
|
|
12789
13170
|
capabilitiesById,
|
|
12790
13171
|
pagesById,
|
|
13172
|
+
menusByKey,
|
|
12791
13173
|
nodes: Object.freeze(nodes),
|
|
12792
13174
|
edges: Object.freeze(edges)
|
|
12793
13175
|
});
|
|
@@ -12866,6 +13248,512 @@ var buildChangeImpactGraph = (previousInput, nextInput, generatedAt = (/* @__PUR
|
|
|
12866
13248
|
});
|
|
12867
13249
|
};
|
|
12868
13250
|
|
|
13251
|
+
// src/runtime/menu-compiler.ts
|
|
13252
|
+
var MenuCompilationError = class extends Error {
|
|
13253
|
+
constructor(code, path, message) {
|
|
13254
|
+
super(`${path}: ${message}`);
|
|
13255
|
+
this.name = "MenuCompilationError";
|
|
13256
|
+
this.code = code;
|
|
13257
|
+
this.path = path;
|
|
13258
|
+
}
|
|
13259
|
+
};
|
|
13260
|
+
var menuKey = (applicationId, surface, menuId) => `${applicationId}\0${surface}\0${menuId}`;
|
|
13261
|
+
var pageKey = (page) => `${page.applicationId}\0${page.pageId}`;
|
|
13262
|
+
var targetKey = (page, activationId) => `${page.applicationId}\0${page.pageId}\0${activationId}`;
|
|
13263
|
+
var actionKey = (applicationId, actionRef) => `${applicationId}\0${actionRef}`;
|
|
13264
|
+
var providerKey = (applicationId, providerId) => `${applicationId}\0${providerId}`;
|
|
13265
|
+
var stableSerialize = (value) => {
|
|
13266
|
+
if (value === void 0) return "null";
|
|
13267
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "null";
|
|
13268
|
+
if (Array.isArray(value)) return `[${value.map((item) => stableSerialize(item)).join(",")}]`;
|
|
13269
|
+
const record = value;
|
|
13270
|
+
return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${stableSerialize(record[key])}`).join(",")}}`;
|
|
13271
|
+
};
|
|
13272
|
+
var deepFreeze = (value) => {
|
|
13273
|
+
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
13274
|
+
Object.values(value).forEach((child) => deepFreeze(child));
|
|
13275
|
+
return Object.freeze(value);
|
|
13276
|
+
};
|
|
13277
|
+
var SHA256_INITIAL = [
|
|
13278
|
+
1779033703,
|
|
13279
|
+
3144134277,
|
|
13280
|
+
1013904242,
|
|
13281
|
+
2773480762,
|
|
13282
|
+
1359893119,
|
|
13283
|
+
2600822924,
|
|
13284
|
+
528734635,
|
|
13285
|
+
1541459225
|
|
13286
|
+
];
|
|
13287
|
+
var SHA256_ROUND = [
|
|
13288
|
+
1116352408,
|
|
13289
|
+
1899447441,
|
|
13290
|
+
3049323471,
|
|
13291
|
+
3921009573,
|
|
13292
|
+
961987163,
|
|
13293
|
+
1508970993,
|
|
13294
|
+
2453635748,
|
|
13295
|
+
2870763221,
|
|
13296
|
+
3624381080,
|
|
13297
|
+
310598401,
|
|
13298
|
+
607225278,
|
|
13299
|
+
1426881987,
|
|
13300
|
+
1925078388,
|
|
13301
|
+
2162078206,
|
|
13302
|
+
2614888103,
|
|
13303
|
+
3248222580,
|
|
13304
|
+
3835390401,
|
|
13305
|
+
4022224774,
|
|
13306
|
+
264347078,
|
|
13307
|
+
604807628,
|
|
13308
|
+
770255983,
|
|
13309
|
+
1249150122,
|
|
13310
|
+
1555081692,
|
|
13311
|
+
1996064986,
|
|
13312
|
+
2554220882,
|
|
13313
|
+
2821834349,
|
|
13314
|
+
2952996808,
|
|
13315
|
+
3210313671,
|
|
13316
|
+
3336571891,
|
|
13317
|
+
3584528711,
|
|
13318
|
+
113926993,
|
|
13319
|
+
338241895,
|
|
13320
|
+
666307205,
|
|
13321
|
+
773529912,
|
|
13322
|
+
1294757372,
|
|
13323
|
+
1396182291,
|
|
13324
|
+
1695183700,
|
|
13325
|
+
1986661051,
|
|
13326
|
+
2177026350,
|
|
13327
|
+
2456956037,
|
|
13328
|
+
2730485921,
|
|
13329
|
+
2820302411,
|
|
13330
|
+
3259730800,
|
|
13331
|
+
3345764771,
|
|
13332
|
+
3516065817,
|
|
13333
|
+
3600352804,
|
|
13334
|
+
4094571909,
|
|
13335
|
+
275423344,
|
|
13336
|
+
430227734,
|
|
13337
|
+
506948616,
|
|
13338
|
+
659060556,
|
|
13339
|
+
883997877,
|
|
13340
|
+
958139571,
|
|
13341
|
+
1322822218,
|
|
13342
|
+
1537002063,
|
|
13343
|
+
1747873779,
|
|
13344
|
+
1955562222,
|
|
13345
|
+
2024104815,
|
|
13346
|
+
2227730452,
|
|
13347
|
+
2361852424,
|
|
13348
|
+
2428436474,
|
|
13349
|
+
2756734187,
|
|
13350
|
+
3204031479,
|
|
13351
|
+
3329325298
|
|
13352
|
+
];
|
|
13353
|
+
var rotateRight = (value, amount) => value >>> amount | value << 32 - amount;
|
|
13354
|
+
var sha256Hex = (value) => {
|
|
13355
|
+
const source = [...new TextEncoder().encode(value)];
|
|
13356
|
+
const bitLength = source.length * 8;
|
|
13357
|
+
source.push(128);
|
|
13358
|
+
while (source.length % 64 !== 56) source.push(0);
|
|
13359
|
+
const high = Math.floor(bitLength / 4294967296);
|
|
13360
|
+
const low = bitLength >>> 0;
|
|
13361
|
+
for (let shift = 24; shift >= 0; shift -= 8) source.push(high >>> shift & 255);
|
|
13362
|
+
for (let shift = 24; shift >= 0; shift -= 8) source.push(low >>> shift & 255);
|
|
13363
|
+
const hash = [...SHA256_INITIAL];
|
|
13364
|
+
const words = new Array(64).fill(0);
|
|
13365
|
+
for (let offset = 0; offset < source.length; offset += 64) {
|
|
13366
|
+
for (let index = 0; index < 16; index += 1) {
|
|
13367
|
+
const start = offset + index * 4;
|
|
13368
|
+
words[index] = (source[start] << 24 | source[start + 1] << 16 | source[start + 2] << 8 | source[start + 3]) >>> 0;
|
|
13369
|
+
}
|
|
13370
|
+
for (let index = 16; index < 64; index += 1) {
|
|
13371
|
+
const previous = words[index - 15];
|
|
13372
|
+
const recent = words[index - 2];
|
|
13373
|
+
const small0 = rotateRight(previous, 7) ^ rotateRight(previous, 18) ^ previous >>> 3;
|
|
13374
|
+
const small1 = rotateRight(recent, 17) ^ rotateRight(recent, 19) ^ recent >>> 10;
|
|
13375
|
+
words[index] = words[index - 16] + small0 + words[index - 7] + small1 >>> 0;
|
|
13376
|
+
}
|
|
13377
|
+
let [a, b, c, d, e, f, g, h] = hash;
|
|
13378
|
+
for (let index = 0; index < 64; index += 1) {
|
|
13379
|
+
const big1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
|
|
13380
|
+
const choice = e & f ^ ~e & g;
|
|
13381
|
+
const temp1 = h + big1 + choice + SHA256_ROUND[index] + words[index] >>> 0;
|
|
13382
|
+
const big0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
|
|
13383
|
+
const majority = a & b ^ a & c ^ b & c;
|
|
13384
|
+
const temp2 = big0 + majority >>> 0;
|
|
13385
|
+
h = g;
|
|
13386
|
+
g = f;
|
|
13387
|
+
f = e;
|
|
13388
|
+
e = d + temp1 >>> 0;
|
|
13389
|
+
d = c;
|
|
13390
|
+
c = b;
|
|
13391
|
+
b = a;
|
|
13392
|
+
a = temp1 + temp2 >>> 0;
|
|
13393
|
+
}
|
|
13394
|
+
hash[0] = hash[0] + a >>> 0;
|
|
13395
|
+
hash[1] = hash[1] + b >>> 0;
|
|
13396
|
+
hash[2] = hash[2] + c >>> 0;
|
|
13397
|
+
hash[3] = hash[3] + d >>> 0;
|
|
13398
|
+
hash[4] = hash[4] + e >>> 0;
|
|
13399
|
+
hash[5] = hash[5] + f >>> 0;
|
|
13400
|
+
hash[6] = hash[6] + g >>> 0;
|
|
13401
|
+
hash[7] = hash[7] + h >>> 0;
|
|
13402
|
+
}
|
|
13403
|
+
return hash.map((part) => part.toString(16).padStart(8, "0")).join("");
|
|
13404
|
+
};
|
|
13405
|
+
var uniqueIndex2 = (values, key, path) => {
|
|
13406
|
+
const result = /* @__PURE__ */ new Map();
|
|
13407
|
+
values.forEach((value, index) => {
|
|
13408
|
+
const identity = key(value);
|
|
13409
|
+
if (result.has(identity)) {
|
|
13410
|
+
throw new MenuCompilationError(
|
|
13411
|
+
"duplicate-registration",
|
|
13412
|
+
`${path}[${index}]`,
|
|
13413
|
+
`Duplicate registry identity: ${identity.split("\0").join("/")}`
|
|
13414
|
+
);
|
|
13415
|
+
}
|
|
13416
|
+
result.set(identity, value);
|
|
13417
|
+
});
|
|
13418
|
+
return result;
|
|
13419
|
+
};
|
|
13420
|
+
var normalizedSiblingOrder = (left, right) => left.order - right.order || left.nodeId.localeCompare(right.nodeId);
|
|
13421
|
+
var normalizeNodeOrder = (nodes) => {
|
|
13422
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
13423
|
+
nodes.forEach((node) => {
|
|
13424
|
+
const parent = node.parentNodeId ?? "";
|
|
13425
|
+
const children = childrenByParent.get(parent) ?? [];
|
|
13426
|
+
children.push(node);
|
|
13427
|
+
childrenByParent.set(parent, children);
|
|
13428
|
+
});
|
|
13429
|
+
childrenByParent.forEach((children) => children.sort(normalizedSiblingOrder));
|
|
13430
|
+
const ordered = [];
|
|
13431
|
+
const appendChildren = (parentNodeId) => {
|
|
13432
|
+
for (const node of childrenByParent.get(parentNodeId) ?? []) {
|
|
13433
|
+
ordered.push(node);
|
|
13434
|
+
appendChildren(node.nodeId);
|
|
13435
|
+
}
|
|
13436
|
+
};
|
|
13437
|
+
appendChildren("");
|
|
13438
|
+
return ordered;
|
|
13439
|
+
};
|
|
13440
|
+
var requirementFromPage = (registration) => ({
|
|
13441
|
+
authenticated: registration.page.visibility.authenticated,
|
|
13442
|
+
permissionAllOf: registration.page.visibility.permissionAllOf,
|
|
13443
|
+
permissionAnyOf: registration.page.visibility.permissionAnyOf,
|
|
13444
|
+
featureFlags: registration.page.visibility.featureFlags
|
|
13445
|
+
});
|
|
13446
|
+
var validatePermissionCodes = (permissions, knownPermissions, path) => {
|
|
13447
|
+
permissions.forEach((permission, index) => {
|
|
13448
|
+
if (!knownPermissions.has(permission)) {
|
|
13449
|
+
throw new MenuCompilationError(
|
|
13450
|
+
"unknown-permission",
|
|
13451
|
+
`${path}[${index}]`,
|
|
13452
|
+
`Unknown platform permission: ${permission}`
|
|
13453
|
+
);
|
|
13454
|
+
}
|
|
13455
|
+
});
|
|
13456
|
+
};
|
|
13457
|
+
var validateInput = (value, schemaRef, validators, path) => {
|
|
13458
|
+
if (!schemaRef) {
|
|
13459
|
+
throw new MenuCompilationError(
|
|
13460
|
+
"missing-input-schema",
|
|
13461
|
+
path,
|
|
13462
|
+
"Input is configured but the target has no input schema reference."
|
|
13463
|
+
);
|
|
13464
|
+
}
|
|
13465
|
+
const validator = validators.get(schemaRef);
|
|
13466
|
+
if (!validator) {
|
|
13467
|
+
throw new MenuCompilationError(
|
|
13468
|
+
"unknown-input-schema",
|
|
13469
|
+
path,
|
|
13470
|
+
`No input validator is registered for ${schemaRef}.`
|
|
13471
|
+
);
|
|
13472
|
+
}
|
|
13473
|
+
try {
|
|
13474
|
+
return MenuBoundedInputSchema.parse(validator(value));
|
|
13475
|
+
} catch (error) {
|
|
13476
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
13477
|
+
throw new MenuCompilationError("invalid-input", path, `Input validation failed for ${schemaRef}: ${message}`);
|
|
13478
|
+
}
|
|
13479
|
+
};
|
|
13480
|
+
var evaluateAccess = (item, context) => {
|
|
13481
|
+
const reasons = [];
|
|
13482
|
+
const protectedBySession = item.access.authenticated || item.access.permissionAllOf.length > 0 || item.access.permissionAnyOf.length > 0 || item.access.requiredPermission !== void 0;
|
|
13483
|
+
if (!context.sessionResolved && protectedBySession) reasons.push("session-unresolved");
|
|
13484
|
+
if (item.access.authenticated && !context.authenticated) reasons.push("authentication");
|
|
13485
|
+
const granted = new Set(context.permissionCodes);
|
|
13486
|
+
const elevated = context.isKernelSuperAdmin === true || granted.has("*");
|
|
13487
|
+
if (item.access.permissionAllOf.some((permission) => !granted.has(permission))) {
|
|
13488
|
+
reasons.push("permission-all");
|
|
13489
|
+
}
|
|
13490
|
+
if (item.access.permissionAnyOf.length > 0 && !item.access.permissionAnyOf.some((permission) => granted.has(permission))) {
|
|
13491
|
+
reasons.push("permission-any");
|
|
13492
|
+
}
|
|
13493
|
+
if (!elevated && item.access.requiredPermission && !granted.has(item.access.requiredPermission)) {
|
|
13494
|
+
reasons.push("required-permission");
|
|
13495
|
+
}
|
|
13496
|
+
if (item.access.featureFlags.some((flag) => context.featureFlags[flag] !== true)) {
|
|
13497
|
+
reasons.push("feature-flag");
|
|
13498
|
+
}
|
|
13499
|
+
return Object.freeze({ allowed: reasons.length === 0, reasons: Object.freeze(reasons) });
|
|
13500
|
+
};
|
|
13501
|
+
var resolveMenuActivationId = (page, activationId) => activationId ?? page.pageId;
|
|
13502
|
+
var readMenuActivationFromSearch = (search) => {
|
|
13503
|
+
const params = typeof search === "string" ? new URLSearchParams(search) : search;
|
|
13504
|
+
const value = params.get(MENU_ACTIVATION_QUERY_PARAMETER)?.trim();
|
|
13505
|
+
return value || void 0;
|
|
13506
|
+
};
|
|
13507
|
+
var serializeMenuActivationSearch = (search, page, activationId) => {
|
|
13508
|
+
const params = new URLSearchParams(typeof search === "string" ? search : search.toString());
|
|
13509
|
+
const effectiveActivationId = resolveMenuActivationId(page, activationId);
|
|
13510
|
+
if (effectiveActivationId === page.pageId) params.delete(MENU_ACTIVATION_QUERY_PARAMETER);
|
|
13511
|
+
else params.set(MENU_ACTIVATION_QUERY_PARAMETER, effectiveActivationId);
|
|
13512
|
+
return params.toString();
|
|
13513
|
+
};
|
|
13514
|
+
var isCompiledMenuItemSelected = (item, page, activationId) => item.behavior.kind === "navigate" && pageKey(item.behavior.page) === pageKey(page) && item.behavior.activationId === resolveMenuActivationId(page, activationId);
|
|
13515
|
+
var compileMenuRuntimeBundle = (input) => {
|
|
13516
|
+
const applicationId = ContractIdentifierSchema.parse(input.applicationId);
|
|
13517
|
+
const supportedSurfaces = new Set(input.supportedSurfaces.map((surface) => ContractIdentifierSchema.parse(surface)));
|
|
13518
|
+
const definitions = input.definitions.map((definition) => MenuDefinitionSchema.parse(definition));
|
|
13519
|
+
const pages = input.pages.map((registration) => MenuPageRegistrationSchema.parse(registration));
|
|
13520
|
+
const actions = input.actions.map((registration) => MenuActionRegistrationSchema.parse(registration));
|
|
13521
|
+
const contributionProviders = input.contributionProviders.map((registration) => MenuContributionProviderRegistrationSchema.parse(registration));
|
|
13522
|
+
const inputValidators = input.inputValidators ?? /* @__PURE__ */ new Map();
|
|
13523
|
+
const knownPermissions = new Set(input.permissionCodes.map((permission) => ContractIdentifierSchema.parse(permission)));
|
|
13524
|
+
pages.forEach((registration, index) => {
|
|
13525
|
+
if (!registration.page.visibility.productContexts.some((context) => context === registration.applicationId)) {
|
|
13526
|
+
throw new MenuCompilationError(
|
|
13527
|
+
"invalid-page-application",
|
|
13528
|
+
`pages[${index}].applicationId`,
|
|
13529
|
+
`Page ${registration.page.pageId} is not visible in ${registration.applicationId}.`
|
|
13530
|
+
);
|
|
13531
|
+
}
|
|
13532
|
+
});
|
|
13533
|
+
const pagesByKey = uniqueIndex2(pages, (registration) => pageKey({
|
|
13534
|
+
applicationId: registration.applicationId,
|
|
13535
|
+
pageId: registration.page.pageId
|
|
13536
|
+
}), "pages");
|
|
13537
|
+
const actionsByKey = uniqueIndex2(actions, (registration) => actionKey(
|
|
13538
|
+
registration.applicationId,
|
|
13539
|
+
registration.actionRef
|
|
13540
|
+
), "actions");
|
|
13541
|
+
const providersByKey = uniqueIndex2(contributionProviders, (registration) => providerKey(
|
|
13542
|
+
registration.applicationId,
|
|
13543
|
+
registration.providerId
|
|
13544
|
+
), "contributionProviders");
|
|
13545
|
+
const definitionsByKey = /* @__PURE__ */ new Map();
|
|
13546
|
+
definitions.forEach((definition, index) => {
|
|
13547
|
+
const identity = menuKey(definition.applicationId, definition.surface, definition.menuId);
|
|
13548
|
+
if (definitionsByKey.has(identity)) {
|
|
13549
|
+
throw new MenuCompilationError(
|
|
13550
|
+
"duplicate-definition",
|
|
13551
|
+
`definitions[${index}]`,
|
|
13552
|
+
`Duplicate menu definition: ${definition.applicationId}/${definition.surface}/${definition.menuId}`
|
|
13553
|
+
);
|
|
13554
|
+
}
|
|
13555
|
+
definitionsByKey.set(identity, definition);
|
|
13556
|
+
});
|
|
13557
|
+
const targetSourceSignatures = /* @__PURE__ */ new Map();
|
|
13558
|
+
const navigationTargetsByKey = /* @__PURE__ */ new Map();
|
|
13559
|
+
const serverInputByTargetKey = /* @__PURE__ */ new Map();
|
|
13560
|
+
const requestedTargetKeys = /* @__PURE__ */ new Set();
|
|
13561
|
+
const requestedMenus = [];
|
|
13562
|
+
definitions.forEach((definition, definitionIndex) => {
|
|
13563
|
+
if (definition.applicationId === applicationId && !supportedSurfaces.has(definition.surface)) {
|
|
13564
|
+
throw new MenuCompilationError(
|
|
13565
|
+
"unsupported-surface",
|
|
13566
|
+
`definitions[${definitionIndex}].surface`,
|
|
13567
|
+
`Application ${applicationId} does not support menu surface ${definition.surface}.`
|
|
13568
|
+
);
|
|
13569
|
+
}
|
|
13570
|
+
const compiledNodes = definition.nodes.map((node, nodeIndex) => {
|
|
13571
|
+
if (node.kind !== "item") return node;
|
|
13572
|
+
const nodePath = `definitions[${definitionIndex}].nodes[${nodeIndex}]`;
|
|
13573
|
+
if (node.requiredPermission && !knownPermissions.has(node.requiredPermission)) {
|
|
13574
|
+
throw new MenuCompilationError(
|
|
13575
|
+
"unknown-permission",
|
|
13576
|
+
`${nodePath}.requiredPermission`,
|
|
13577
|
+
`Unknown platform permission: ${node.requiredPermission}`
|
|
13578
|
+
);
|
|
13579
|
+
}
|
|
13580
|
+
let access;
|
|
13581
|
+
if (node.behavior.kind === "navigate") {
|
|
13582
|
+
const registration = pagesByKey.get(pageKey(node.behavior.page));
|
|
13583
|
+
if (!registration) {
|
|
13584
|
+
throw new MenuCompilationError(
|
|
13585
|
+
"unknown-page",
|
|
13586
|
+
`${nodePath}.behavior.page`,
|
|
13587
|
+
`Unknown page reference: ${node.behavior.page.applicationId}/${node.behavior.page.pageId}`
|
|
13588
|
+
);
|
|
13589
|
+
}
|
|
13590
|
+
access = requirementFromPage(registration);
|
|
13591
|
+
validatePermissionCodes(access.permissionAllOf, knownPermissions, `${nodePath}.targetAccess.permissionAllOf`);
|
|
13592
|
+
validatePermissionCodes(access.permissionAnyOf, knownPermissions, `${nodePath}.targetAccess.permissionAnyOf`);
|
|
13593
|
+
const activationId = resolveMenuActivationId(node.behavior.page, node.behavior.activationId);
|
|
13594
|
+
const identity = targetKey(node.behavior.page, activationId);
|
|
13595
|
+
let runtimeInput;
|
|
13596
|
+
let normalizedSourceInput;
|
|
13597
|
+
if (node.behavior.input) {
|
|
13598
|
+
const normalized = validateInput(
|
|
13599
|
+
node.behavior.input.value,
|
|
13600
|
+
registration.page.input?.schemaRef,
|
|
13601
|
+
inputValidators,
|
|
13602
|
+
`${nodePath}.behavior.input.value`
|
|
13603
|
+
);
|
|
13604
|
+
normalizedSourceInput = { exposure: node.behavior.input.exposure, value: normalized };
|
|
13605
|
+
runtimeInput = node.behavior.input.exposure === "client" ? { exposure: "client", value: normalized } : { exposure: "server" };
|
|
13606
|
+
if (node.behavior.input.exposure === "server" && definition.applicationId === applicationId) {
|
|
13607
|
+
serverInputByTargetKey.set(identity, deepFreeze(normalized));
|
|
13608
|
+
}
|
|
13609
|
+
}
|
|
13610
|
+
const signature = stableSerialize({
|
|
13611
|
+
kind: "navigate",
|
|
13612
|
+
page: node.behavior.page,
|
|
13613
|
+
activationId,
|
|
13614
|
+
input: normalizedSourceInput
|
|
13615
|
+
});
|
|
13616
|
+
const existingSignature = targetSourceSignatures.get(identity);
|
|
13617
|
+
if (existingSignature !== void 0 && existingSignature !== signature) {
|
|
13618
|
+
throw new MenuCompilationError(
|
|
13619
|
+
"conflicting-navigation-target",
|
|
13620
|
+
`${nodePath}.behavior`,
|
|
13621
|
+
`Navigation target ${node.behavior.page.applicationId}/${node.behavior.page.pageId}/${activationId} has conflicting behavior or input.`
|
|
13622
|
+
);
|
|
13623
|
+
}
|
|
13624
|
+
targetSourceSignatures.set(identity, signature);
|
|
13625
|
+
if (!navigationTargetsByKey.has(identity)) {
|
|
13626
|
+
navigationTargetsByKey.set(identity, {
|
|
13627
|
+
page: node.behavior.page,
|
|
13628
|
+
activationId,
|
|
13629
|
+
input: runtimeInput
|
|
13630
|
+
});
|
|
13631
|
+
}
|
|
13632
|
+
if (definition.applicationId === applicationId) requestedTargetKeys.add(identity);
|
|
13633
|
+
const { requiredPermission: requiredPermission2, behavior: _behavior2, ...presentation2 } = node;
|
|
13634
|
+
return CompiledMenuItemNodeSchema.parse({
|
|
13635
|
+
...presentation2,
|
|
13636
|
+
behavior: {
|
|
13637
|
+
kind: "navigate",
|
|
13638
|
+
page: node.behavior.page,
|
|
13639
|
+
activationId,
|
|
13640
|
+
input: runtimeInput
|
|
13641
|
+
},
|
|
13642
|
+
access: { ...access, requiredPermission: requiredPermission2 }
|
|
13643
|
+
});
|
|
13644
|
+
}
|
|
13645
|
+
const action = actionsByKey.get(actionKey(definition.applicationId, node.behavior.actionRef));
|
|
13646
|
+
if (!action) {
|
|
13647
|
+
throw new MenuCompilationError(
|
|
13648
|
+
"unknown-action",
|
|
13649
|
+
`${nodePath}.behavior.actionRef`,
|
|
13650
|
+
`Unknown action reference for ${definition.applicationId}: ${node.behavior.actionRef}`
|
|
13651
|
+
);
|
|
13652
|
+
}
|
|
13653
|
+
access = action.access;
|
|
13654
|
+
validatePermissionCodes(access.permissionAllOf, knownPermissions, `${nodePath}.targetAccess.permissionAllOf`);
|
|
13655
|
+
validatePermissionCodes(access.permissionAnyOf, knownPermissions, `${nodePath}.targetAccess.permissionAnyOf`);
|
|
13656
|
+
const actionInput = node.behavior.input ? validateInput(node.behavior.input, action.inputSchemaRef, inputValidators, `${nodePath}.behavior.input`) : void 0;
|
|
13657
|
+
const { requiredPermission, behavior: _behavior, ...presentation } = node;
|
|
13658
|
+
return CompiledMenuItemNodeSchema.parse({
|
|
13659
|
+
...presentation,
|
|
13660
|
+
behavior: { kind: "action", actionRef: node.behavior.actionRef, input: actionInput },
|
|
13661
|
+
access: { ...access, requiredPermission }
|
|
13662
|
+
});
|
|
13663
|
+
});
|
|
13664
|
+
definition.contributions.forEach((contribution, contributionIndex) => {
|
|
13665
|
+
const provider = providersByKey.get(providerKey(definition.applicationId, contribution.providerId));
|
|
13666
|
+
const path = `definitions[${definitionIndex}].contributions[${contributionIndex}].providerId`;
|
|
13667
|
+
if (!provider) {
|
|
13668
|
+
throw new MenuCompilationError(
|
|
13669
|
+
"unknown-contribution-provider",
|
|
13670
|
+
path,
|
|
13671
|
+
`Unknown contribution provider for ${definition.applicationId}: ${contribution.providerId}`
|
|
13672
|
+
);
|
|
13673
|
+
}
|
|
13674
|
+
if (provider.surfaces && !provider.surfaces.includes(definition.surface)) {
|
|
13675
|
+
throw new MenuCompilationError(
|
|
13676
|
+
"unsupported-contribution-surface",
|
|
13677
|
+
path,
|
|
13678
|
+
`Provider ${contribution.providerId} does not support surface ${definition.surface}.`
|
|
13679
|
+
);
|
|
13680
|
+
}
|
|
13681
|
+
});
|
|
13682
|
+
if (definition.applicationId !== applicationId) return;
|
|
13683
|
+
requestedMenus.push(CompiledMenuProjectionSchema.parse({
|
|
13684
|
+
applicationId: definition.applicationId,
|
|
13685
|
+
surface: definition.surface,
|
|
13686
|
+
menuId: definition.menuId,
|
|
13687
|
+
nodes: normalizeNodeOrder(compiledNodes),
|
|
13688
|
+
contributions: [...definition.contributions].sort((left, right) => (left.parentNodeId ?? "").localeCompare(right.parentNodeId ?? "") || left.order - right.order || left.providerId.localeCompare(right.providerId))
|
|
13689
|
+
}));
|
|
13690
|
+
});
|
|
13691
|
+
const menus = requestedMenus.sort((left, right) => left.surface.localeCompare(right.surface) || left.menuId.localeCompare(right.menuId));
|
|
13692
|
+
const navigationTargets = [...requestedTargetKeys].map((identity) => navigationTargetsByKey.get(identity)).filter((target) => target !== void 0).sort((left, right) => left.page.applicationId.localeCompare(right.page.applicationId) || left.page.pageId.localeCompare(right.page.pageId) || left.activationId.localeCompare(right.activationId));
|
|
13693
|
+
const unsignedDocument = {
|
|
13694
|
+
contract: "MenuRuntimeBundle",
|
|
13695
|
+
version: MENU_CONTRACT_VERSION,
|
|
13696
|
+
applicationId,
|
|
13697
|
+
sourceVersion: input.sourceVersion,
|
|
13698
|
+
menus,
|
|
13699
|
+
navigationTargets,
|
|
13700
|
+
sourceMap: Object.fromEntries(
|
|
13701
|
+
Object.entries(input.sourceMap ?? {}).sort(([left], [right]) => left.localeCompare(right))
|
|
13702
|
+
)
|
|
13703
|
+
};
|
|
13704
|
+
const document = MenuRuntimeBundleSchema.parse({
|
|
13705
|
+
...unsignedDocument,
|
|
13706
|
+
contentHash: sha256Hex(stableSerialize(unsignedDocument))
|
|
13707
|
+
});
|
|
13708
|
+
const menusByKey = new Map(document.menus.map((menu) => [
|
|
13709
|
+
menuKey(menu.applicationId, menu.surface, menu.menuId),
|
|
13710
|
+
menu
|
|
13711
|
+
]));
|
|
13712
|
+
const documentTargetsByKey = new Map(document.navigationTargets.map((target) => [
|
|
13713
|
+
targetKey(target.page, target.activationId),
|
|
13714
|
+
target
|
|
13715
|
+
]));
|
|
13716
|
+
const resolveNavigationTarget = (page, explicitActivationId) => {
|
|
13717
|
+
const parsedPage = MenuPageRefSchema.parse(page);
|
|
13718
|
+
if (explicitActivationId !== void 0) {
|
|
13719
|
+
const parsedActivation = ContractIdentifierSchema.safeParse(explicitActivationId);
|
|
13720
|
+
if (!parsedActivation.success) return Object.freeze({ status: "invalid", reason: "invalid-activation" });
|
|
13721
|
+
const target2 = documentTargetsByKey.get(targetKey(parsedPage, parsedActivation.data));
|
|
13722
|
+
if (target2) return Object.freeze({ status: "resolved", target: target2 });
|
|
13723
|
+
const sameActivation = document.navigationTargets.find((candidate) => candidate.page.applicationId === parsedPage.applicationId && candidate.activationId === parsedActivation.data);
|
|
13724
|
+
return Object.freeze({
|
|
13725
|
+
status: "invalid",
|
|
13726
|
+
reason: sameActivation ? "page-mismatch" : "unknown-activation"
|
|
13727
|
+
});
|
|
13728
|
+
}
|
|
13729
|
+
const target = documentTargetsByKey.get(targetKey(parsedPage, parsedPage.pageId));
|
|
13730
|
+
return target ? Object.freeze({ status: "resolved", target }) : Object.freeze({ status: "unmatched" });
|
|
13731
|
+
};
|
|
13732
|
+
return Object.freeze({
|
|
13733
|
+
document: deepFreeze(document),
|
|
13734
|
+
menusByKey,
|
|
13735
|
+
navigationTargetsByKey: documentTargetsByKey,
|
|
13736
|
+
serverInputByTargetKey,
|
|
13737
|
+
evaluateItemAccess: evaluateAccess,
|
|
13738
|
+
resolveNavigationTarget,
|
|
13739
|
+
selectedNodeIds(menu, page, activationId) {
|
|
13740
|
+
if (menu.applicationId !== document.applicationId) return /* @__PURE__ */ new Set();
|
|
13741
|
+
const nodesById = new Map(menu.nodes.map((node) => [node.nodeId, node]));
|
|
13742
|
+
const selected = /* @__PURE__ */ new Set();
|
|
13743
|
+
for (const node of menu.nodes) {
|
|
13744
|
+
if (node.kind !== "item" || !isCompiledMenuItemSelected(node, page, activationId)) continue;
|
|
13745
|
+
selected.add(node.nodeId);
|
|
13746
|
+
let parentNodeId = node.parentNodeId;
|
|
13747
|
+
while (parentNodeId) {
|
|
13748
|
+
selected.add(parentNodeId);
|
|
13749
|
+
parentNodeId = nodesById.get(parentNodeId)?.parentNodeId;
|
|
13750
|
+
}
|
|
13751
|
+
}
|
|
13752
|
+
return selected;
|
|
13753
|
+
}
|
|
13754
|
+
});
|
|
13755
|
+
};
|
|
13756
|
+
|
|
12869
13757
|
// src/runtime/view-provider-registry.ts
|
|
12870
13758
|
var referenceVersion = (version) => version === void 0 ? void 0 : String(version);
|
|
12871
13759
|
var sameStringSet = (left, right) => {
|
|
@@ -13141,7 +14029,7 @@ var compilePageRuntimeProjection = (input) => {
|
|
|
13141
14029
|
const guardsByPageId = unique2(document.guards, (guard) => guard.pageId, "guard pageId");
|
|
13142
14030
|
const renderersByPageId = unique2(document.renderers, (renderer) => renderer.pageId, "renderer pageId");
|
|
13143
14031
|
const matchers = pages.map((page) => ({ page, pattern: routePattern(page.routePath), specificity: routeSpecificity(page.routePath) })).sort((left, right) => right.specificity - left.specificity || left.page.pageId.localeCompare(right.page.pageId));
|
|
13144
|
-
const
|
|
14032
|
+
const evaluateAccess2 = (pageId, context) => {
|
|
13145
14033
|
const guard = guardsByPageId.get(pageId);
|
|
13146
14034
|
if (!guard) throw new Error(`Unknown page guard: ${pageId}`);
|
|
13147
14035
|
const reasons = [];
|
|
@@ -13164,9 +14052,9 @@ var compilePageRuntimeProjection = (input) => {
|
|
|
13164
14052
|
navigationByPageId,
|
|
13165
14053
|
guardsByPageId,
|
|
13166
14054
|
renderersByPageId,
|
|
13167
|
-
evaluateAccess,
|
|
14055
|
+
evaluateAccess: evaluateAccess2,
|
|
13168
14056
|
visibleNavigation(context) {
|
|
13169
|
-
return Object.freeze(document.navigation.filter((item) =>
|
|
14057
|
+
return Object.freeze(document.navigation.filter((item) => evaluateAccess2(item.pageId, context).allowed));
|
|
13170
14058
|
},
|
|
13171
14059
|
matchRoute(pathname) {
|
|
13172
14060
|
const path = pathname.split("?")[0]?.split("#")[0] || "/";
|
|
@@ -13346,6 +14234,7 @@ var compileTenantRuntimeConfig = (input) => {
|
|
|
13346
14234
|
dataBinding: productConfig.dataBinding,
|
|
13347
14235
|
sourceMap: productConfig.sourceMap,
|
|
13348
14236
|
warnings: productConfig.warnings,
|
|
14237
|
+
menuBundle: input.menuBundle,
|
|
13349
14238
|
applicationConfig: productConfig.applicationConfig
|
|
13350
14239
|
}));
|
|
13351
14240
|
};
|
|
@@ -13656,6 +14545,8 @@ export {
|
|
|
13656
14545
|
BrandBodySchema,
|
|
13657
14546
|
BrandGeneticsProfileSchema,
|
|
13658
14547
|
CODE_LANGUAGES,
|
|
14548
|
+
CURRENT_USER_MENU_ACTION_REFS,
|
|
14549
|
+
CURRENT_USER_MENU_CONTROL_REFS,
|
|
13659
14550
|
CapabilityManifestSchema,
|
|
13660
14551
|
CapabilityProviderBindingSchema,
|
|
13661
14552
|
CapabilityRegistryDocumentSchema,
|
|
@@ -13664,6 +14555,15 @@ export {
|
|
|
13664
14555
|
CapabilitySourceTypeSchema,
|
|
13665
14556
|
ChangeImpactGraphSchema,
|
|
13666
14557
|
ChangeImpactSchema,
|
|
14558
|
+
CompiledMenuActionBehaviorSchema,
|
|
14559
|
+
CompiledMenuBehaviorSchema,
|
|
14560
|
+
CompiledMenuDividerNodeSchema,
|
|
14561
|
+
CompiledMenuGroupNodeSchema,
|
|
14562
|
+
CompiledMenuItemAccessSchema,
|
|
14563
|
+
CompiledMenuItemNodeSchema,
|
|
14564
|
+
CompiledMenuNavigateBehaviorSchema,
|
|
14565
|
+
CompiledMenuNodeSchema,
|
|
14566
|
+
CompiledMenuProjectionSchema,
|
|
13667
14567
|
CompletionEventSchema,
|
|
13668
14568
|
CompletionHeaderSchema,
|
|
13669
14569
|
ConceptDefinitionSchema,
|
|
@@ -13675,6 +14575,14 @@ export {
|
|
|
13675
14575
|
ContractMetadataSchema,
|
|
13676
14576
|
ContractPortSchema,
|
|
13677
14577
|
ContractVersionSchema,
|
|
14578
|
+
CurrentUserMenuActionItemSchema,
|
|
14579
|
+
CurrentUserMenuConfigSchema,
|
|
14580
|
+
CurrentUserMenuControlItemSchema,
|
|
14581
|
+
CurrentUserMenuDisplayTextSchema,
|
|
14582
|
+
CurrentUserMenuItemSchema,
|
|
14583
|
+
CurrentUserMenuNavigationItemSchema,
|
|
14584
|
+
CurrentUserMenuProfileSchema,
|
|
14585
|
+
CurrentUserMenuSectionSchema,
|
|
13678
14586
|
DEFAULT_CONDUCTOR_OWNER_EMAIL,
|
|
13679
14587
|
DataContinuityEnvelopeSchema,
|
|
13680
14588
|
DeclarationGraphEdgeSchema,
|
|
@@ -13689,10 +14597,40 @@ export {
|
|
|
13689
14597
|
IsoDateTimeSchema,
|
|
13690
14598
|
JsonObjectSchema,
|
|
13691
14599
|
JsonValueSchema,
|
|
14600
|
+
LEGACY_CURRENT_USER_MENU_ITEM_IDS,
|
|
13692
14601
|
LineageRecordSchema,
|
|
13693
14602
|
LocaleIdentifierSchema,
|
|
13694
14603
|
LocalizedTextSchema,
|
|
14604
|
+
MENU_ACTIVATION_QUERY_PARAMETER,
|
|
14605
|
+
MENU_CONTRACT_VERSION,
|
|
14606
|
+
MENU_MAX_DEFINITIONS,
|
|
14607
|
+
MENU_MAX_INPUT_BYTES,
|
|
14608
|
+
MENU_MAX_INPUT_VALUES,
|
|
14609
|
+
MENU_MAX_NODES,
|
|
14610
|
+
MENU_MAX_TREE_DEPTH,
|
|
13695
14611
|
MONKEYS_REQUIRED_THEME_TOKEN_PATHS,
|
|
14612
|
+
MenuAccessRequirementSchema,
|
|
14613
|
+
MenuActionBehaviorSchema,
|
|
14614
|
+
MenuActionRegistrationSchema,
|
|
14615
|
+
MenuBehaviorSchema,
|
|
14616
|
+
MenuBoundedInputSchema,
|
|
14617
|
+
MenuCompilationError,
|
|
14618
|
+
MenuContributionProviderRegistrationSchema,
|
|
14619
|
+
MenuContributionResultSchema,
|
|
14620
|
+
MenuContributionSchema,
|
|
14621
|
+
MenuDefinitionSchema,
|
|
14622
|
+
MenuDefinitionSetSchema,
|
|
14623
|
+
MenuDividerNodeSchema,
|
|
14624
|
+
MenuGroupNodeSchema,
|
|
14625
|
+
MenuItemNodeSchema,
|
|
14626
|
+
MenuNavigateBehaviorSchema,
|
|
14627
|
+
MenuNavigationTargetSchema,
|
|
14628
|
+
MenuNodeSchema,
|
|
14629
|
+
MenuPageRefSchema,
|
|
14630
|
+
MenuPageRegistrationSchema,
|
|
14631
|
+
MenuRuntimeBundleSchema,
|
|
14632
|
+
MenuRuntimeInputBindingSchema,
|
|
14633
|
+
MenuSourceInputBindingSchema,
|
|
13696
14634
|
OntologyDefinitionSchema,
|
|
13697
14635
|
OutputRecordSchema,
|
|
13698
14636
|
OverlayNodeSchema,
|
|
@@ -13796,6 +14734,7 @@ export {
|
|
|
13796
14734
|
canonicalContractSchemas,
|
|
13797
14735
|
compileCapabilityRegistry,
|
|
13798
14736
|
compileConductorWorkflowDefinition,
|
|
14737
|
+
compileMenuRuntimeBundle,
|
|
13799
14738
|
compilePageRuntimeProjection,
|
|
13800
14739
|
compileProductDeclaration,
|
|
13801
14740
|
compileProductRuntimeCatalog,
|
|
@@ -13819,6 +14758,7 @@ export {
|
|
|
13819
14758
|
getAgentSessionRuntimeCapabilities,
|
|
13820
14759
|
isAgentResourceModeCompatible,
|
|
13821
14760
|
isAgentSessionTerminalStatus,
|
|
14761
|
+
isCompiledMenuItemSelected,
|
|
13822
14762
|
mergeThemeTokenDocuments,
|
|
13823
14763
|
normalizeAgentExecutionMode,
|
|
13824
14764
|
normalizeAgentMode,
|
|
@@ -13826,9 +14766,12 @@ export {
|
|
|
13826
14766
|
projectAgentSessionEvents,
|
|
13827
14767
|
publishOpenApiToolCapabilityManifests,
|
|
13828
14768
|
readApplicationHandoffFromUrl,
|
|
14769
|
+
readMenuActivationFromSearch,
|
|
13829
14770
|
resolveAgentSessionCommandTransition,
|
|
14771
|
+
resolveMenuActivationId,
|
|
13830
14772
|
resolveThemeTokens,
|
|
13831
14773
|
serializeApplicationHandoff,
|
|
14774
|
+
serializeMenuActivationSearch,
|
|
13832
14775
|
toAgentSessionViewModel,
|
|
13833
14776
|
validateDomainCommand,
|
|
13834
14777
|
validateThemeTokensDocument,
|