@daeda/mcp-pro 0.1.43 → 0.1.44
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/dist/index.js +333 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9383,6 +9383,7 @@ var PipelineStageMetadataSchema = z33.object({
|
|
|
9383
9383
|
var PipelineStageDefinitionSchema = z33.object({
|
|
9384
9384
|
label: z33.string().min(1),
|
|
9385
9385
|
display_order: z33.number().int(),
|
|
9386
|
+
ref: z33.string().min(1).optional(),
|
|
9386
9387
|
metadata: PipelineStageMetadataSchema.optional()
|
|
9387
9388
|
});
|
|
9388
9389
|
var PipelineDefinitionSchema = z33.object({
|
|
@@ -9401,7 +9402,7 @@ var fields7 = [
|
|
|
9401
9402
|
{ name: "object_type", type: "string", required: true, description: "CRM object type (deals, tickets, or custom object ID)" },
|
|
9402
9403
|
{ name: "label", type: "string", required: true, description: "Pipeline name as displayed in HubSpot" },
|
|
9403
9404
|
{ name: "display_order", type: "number", required: true, description: "Pipeline display order among all pipelines" },
|
|
9404
|
-
{ name: "stages", type: "array", required: true, description: "Pipeline stages (at least one required)", itemShape: "{ label: string, display_order: number, metadata?: { probability?: string, ticketState?: string } }" }
|
|
9405
|
+
{ name: "stages", type: "array", required: true, description: "Pipeline stages (at least one required)", itemShape: "{ label: string, display_order: number, ref?: string, metadata?: { probability?: string, ticketState?: string } }" }
|
|
9405
9406
|
];
|
|
9406
9407
|
var createPipelineMeta = {
|
|
9407
9408
|
type: "create_pipeline",
|
|
@@ -9417,9 +9418,9 @@ var createPipelineMeta = {
|
|
|
9417
9418
|
label: "Enterprise Sales",
|
|
9418
9419
|
display_order: 1,
|
|
9419
9420
|
stages: [
|
|
9420
|
-
{ label: "Qualified", display_order: 0, metadata: { probability: "0.2" } },
|
|
9421
|
-
{ label: "Proposal Sent", display_order: 1, metadata: { probability: "0.5" } },
|
|
9422
|
-
{ label: "Closed Won", display_order: 2, metadata: { probability: "1.0" } }
|
|
9421
|
+
{ label: "Qualified", display_order: 0, ref: "stage.enterprise_sales.qualified", metadata: { probability: "0.2" } },
|
|
9422
|
+
{ label: "Proposal Sent", display_order: 1, ref: "stage.enterprise_sales.proposal_sent", metadata: { probability: "0.5" } },
|
|
9423
|
+
{ label: "Closed Won", display_order: 2, ref: "stage.enterprise_sales.closed_won", metadata: { probability: "1.0" } }
|
|
9423
9424
|
]
|
|
9424
9425
|
}
|
|
9425
9426
|
},
|
|
@@ -11695,7 +11696,7 @@ var AssociationSpecSchema = z70.object({
|
|
|
11695
11696
|
}).passthrough();
|
|
11696
11697
|
var StaticValueSchema = z70.object({
|
|
11697
11698
|
type: z70.literal("STATIC_VALUE"),
|
|
11698
|
-
staticValue:
|
|
11699
|
+
staticValue: StringOrPlanRefSchema
|
|
11699
11700
|
}).passthrough();
|
|
11700
11701
|
var ObjectPropertyValueSchema = z70.object({
|
|
11701
11702
|
type: z70.literal("OBJECT_PROPERTY"),
|
|
@@ -11799,6 +11800,104 @@ var StaticBranchInputValueSchema = z70.union([
|
|
|
11799
11800
|
ObjectPropertyValueSchema,
|
|
11800
11801
|
FetchedObjectPropertyValueSchema
|
|
11801
11802
|
]);
|
|
11803
|
+
var hasSourcePattern = (sourceCode, pattern) => pattern.test(sourceCode);
|
|
11804
|
+
var collectLiteralOutputFieldKeys = (sourceCode) => {
|
|
11805
|
+
const matches = [...sourceCode.matchAll(/outputFields\s*:\s*\{([\s\S]*?)\}/g)];
|
|
11806
|
+
const keys = /* @__PURE__ */ new Set();
|
|
11807
|
+
for (const match of matches) {
|
|
11808
|
+
const body = match[1] ?? "";
|
|
11809
|
+
for (const keyMatch of body.matchAll(/(?:^|[,{]\s*)(['"]?)([A-Za-z_$][\w$-]*)\1\s*:/g)) {
|
|
11810
|
+
keys.add(keyMatch[2]);
|
|
11811
|
+
}
|
|
11812
|
+
}
|
|
11813
|
+
return [...keys];
|
|
11814
|
+
};
|
|
11815
|
+
var validateCustomCodeSource = (value, ctx) => {
|
|
11816
|
+
const sourceCode = value.sourceCode;
|
|
11817
|
+
try {
|
|
11818
|
+
new Function(sourceCode);
|
|
11819
|
+
} catch (error) {
|
|
11820
|
+
ctx.addIssue({
|
|
11821
|
+
code: z70.ZodIssueCode.custom,
|
|
11822
|
+
message: `sourceCode must be valid JavaScript: ${error instanceof Error ? error.message : "syntax error"}`,
|
|
11823
|
+
path: ["sourceCode"]
|
|
11824
|
+
});
|
|
11825
|
+
return;
|
|
11826
|
+
}
|
|
11827
|
+
if (!hasSourcePattern(sourceCode, /\b(?:exports|module\.exports)\.main\s*=/)) {
|
|
11828
|
+
ctx.addIssue({
|
|
11829
|
+
code: z70.ZodIssueCode.custom,
|
|
11830
|
+
message: "sourceCode must define exports.main or module.exports.main.",
|
|
11831
|
+
path: ["sourceCode"]
|
|
11832
|
+
});
|
|
11833
|
+
}
|
|
11834
|
+
const hasCallbackContract = hasSourcePattern(sourceCode, /\bcallback\s*\(/);
|
|
11835
|
+
const hasReturnContract = hasSourcePattern(sourceCode, /\breturn\s+(?:await\s+)?\{[\s\S]*?outputFields\s*:/);
|
|
11836
|
+
if (!hasCallbackContract && !hasReturnContract) {
|
|
11837
|
+
ctx.addIssue({
|
|
11838
|
+
code: z70.ZodIssueCode.custom,
|
|
11839
|
+
message: "sourceCode must either call callback(...) or return an object containing outputFields.",
|
|
11840
|
+
path: ["sourceCode"]
|
|
11841
|
+
});
|
|
11842
|
+
}
|
|
11843
|
+
const literalOutputKeys = collectLiteralOutputFieldKeys(sourceCode);
|
|
11844
|
+
const declaredOutputNames = new Set((value.outputFields ?? []).map((field) => field.name));
|
|
11845
|
+
if (declaredOutputNames.size > 0) {
|
|
11846
|
+
for (const field of value.outputFields ?? []) {
|
|
11847
|
+
if (!hasSourcePattern(sourceCode, new RegExp(`\\b${field.name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`))) {
|
|
11848
|
+
ctx.addIssue({
|
|
11849
|
+
code: z70.ZodIssueCode.custom,
|
|
11850
|
+
message: `Declared output field '${field.name}' is not referenced in sourceCode.`,
|
|
11851
|
+
path: ["outputFields"]
|
|
11852
|
+
});
|
|
11853
|
+
}
|
|
11854
|
+
}
|
|
11855
|
+
}
|
|
11856
|
+
for (const literalKey of literalOutputKeys) {
|
|
11857
|
+
if (!declaredOutputNames.has(literalKey)) {
|
|
11858
|
+
ctx.addIssue({
|
|
11859
|
+
code: z70.ZodIssueCode.custom,
|
|
11860
|
+
message: `sourceCode emits outputFields.${literalKey} but it is not declared in outputFields.`,
|
|
11861
|
+
path: ["outputFields"]
|
|
11862
|
+
});
|
|
11863
|
+
}
|
|
11864
|
+
}
|
|
11865
|
+
for (const [index, inputField] of (value.inputFields ?? []).entries()) {
|
|
11866
|
+
if (!hasSourcePattern(sourceCode, new RegExp(`\\b${inputField.name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`))) {
|
|
11867
|
+
ctx.addIssue({
|
|
11868
|
+
code: z70.ZodIssueCode.custom,
|
|
11869
|
+
message: `Declared input field '${inputField.name}' is not referenced in sourceCode.`,
|
|
11870
|
+
path: ["inputFields", index, "name"]
|
|
11871
|
+
});
|
|
11872
|
+
}
|
|
11873
|
+
}
|
|
11874
|
+
for (const [index, secretName] of (value.secretNames ?? []).entries()) {
|
|
11875
|
+
if (!hasSourcePattern(sourceCode, new RegExp(`\\b${secretName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`))) {
|
|
11876
|
+
ctx.addIssue({
|
|
11877
|
+
code: z70.ZodIssueCode.custom,
|
|
11878
|
+
message: `Declared secret '${secretName}' is not referenced in sourceCode.`,
|
|
11879
|
+
path: ["secretNames", index]
|
|
11880
|
+
});
|
|
11881
|
+
}
|
|
11882
|
+
}
|
|
11883
|
+
const dangerousPatterns = [
|
|
11884
|
+
{ pattern: /\beval\s*\(/, message: "sourceCode must not use eval()." },
|
|
11885
|
+
{ pattern: /\bFunction\s*\(/, message: "sourceCode must not construct functions dynamically." },
|
|
11886
|
+
{ pattern: /\brequire\s*\(\s*['"]child_process['"]\s*\)/, message: "sourceCode must not import child_process." },
|
|
11887
|
+
{ pattern: /\bexec(?:Sync)?\s*\(/, message: "sourceCode must not execute shell commands." },
|
|
11888
|
+
{ pattern: /\bspawn\s*\(/, message: "sourceCode must not spawn subprocesses." },
|
|
11889
|
+
{ pattern: /\bfs\.(?:writeFile|writeFileSync|appendFile|appendFileSync)\s*\(/, message: "sourceCode must not write to the filesystem." }
|
|
11890
|
+
];
|
|
11891
|
+
for (const { pattern, message } of dangerousPatterns) {
|
|
11892
|
+
if (hasSourcePattern(sourceCode, pattern)) {
|
|
11893
|
+
ctx.addIssue({
|
|
11894
|
+
code: z70.ZodIssueCode.custom,
|
|
11895
|
+
message,
|
|
11896
|
+
path: ["sourceCode"]
|
|
11897
|
+
});
|
|
11898
|
+
}
|
|
11899
|
+
}
|
|
11900
|
+
};
|
|
11802
11901
|
var SingleConnectionActionBaseSchema = z70.object({
|
|
11803
11902
|
actionId: NonEmptyStringSchema,
|
|
11804
11903
|
actionTypeVersion: z70.number().int().optional(),
|
|
@@ -12072,6 +12171,7 @@ var CustomCodeActionSchema = z70.object({
|
|
|
12072
12171
|
});
|
|
12073
12172
|
}
|
|
12074
12173
|
}
|
|
12174
|
+
validateCustomCodeSource(value, ctx);
|
|
12075
12175
|
});
|
|
12076
12176
|
var WebhookActionSchema = z70.object({
|
|
12077
12177
|
actionId: NonEmptyStringSchema,
|
|
@@ -12664,7 +12764,7 @@ var BUILT_IN_ACTION_TYPES = {
|
|
|
12664
12764
|
connectionType: "SINGLE_CONNECTION",
|
|
12665
12765
|
fields: [
|
|
12666
12766
|
{ name: "secretNames", type: "array", required: false, description: "Optional list of secret names exposed to the runtime." },
|
|
12667
|
-
{ name: "sourceCode", type: "string", required: true, description: "Custom code source body." },
|
|
12767
|
+
{ name: "sourceCode", type: "string", required: true, description: "Custom code source body. It must be valid JavaScript, define exports.main or module.exports.main, and either call callback(...) or return an object containing outputFields." },
|
|
12668
12768
|
{ name: "runtime", type: "string", required: true, description: "Execution runtime. Harvested corpus currently uses NODE20X." },
|
|
12669
12769
|
{ name: "inputFields", type: "array", required: false, description: "Optional named inputs passed into the custom code runtime. Harvested input variants include OBJECT_PROPERTY, FIELD_DATA, ENROLLMENT_EVENT_PROPERTY, and FETCHED_OBJECT_PROPERTY." },
|
|
12670
12770
|
{ name: "outputFields", type: "array", required: false, description: "Optional declared output fields produced by the custom code action. Output types include NUMBER, DATE, STRING, ENUMERATION, DATETIME, and BOOLEAN. ENUMERATION outputs must include an options array." }
|
|
@@ -14619,6 +14719,22 @@ var KNOWN_GUARDRAILS_BY_ACTION_TYPE_ID = {
|
|
|
14619
14719
|
{
|
|
14620
14720
|
code: "ENUM_OUTPUT_OPTIONS_REQUIRED",
|
|
14621
14721
|
message: "CUSTOM_CODE outputFields with type ENUMERATION must include a non-empty options array."
|
|
14722
|
+
},
|
|
14723
|
+
{
|
|
14724
|
+
code: "EXPORTS_MAIN_REQUIRED",
|
|
14725
|
+
message: "sourceCode must define exports.main or module.exports.main."
|
|
14726
|
+
},
|
|
14727
|
+
{
|
|
14728
|
+
code: "CALLBACK_OR_RETURN_CONTRACT",
|
|
14729
|
+
message: "sourceCode must either call callback(...) or return an object containing outputFields."
|
|
14730
|
+
},
|
|
14731
|
+
{
|
|
14732
|
+
code: "DECLARED_IO_MUST_BE_REFERENCED",
|
|
14733
|
+
message: "Declared inputFields, outputFields, and secretNames should all be referenced in sourceCode."
|
|
14734
|
+
},
|
|
14735
|
+
{
|
|
14736
|
+
code: "DANGEROUS_CONSTRUCTS_REJECTED",
|
|
14737
|
+
message: "sourceCode must not use eval, dynamic Function construction, child_process, shell execution, or filesystem writes."
|
|
14622
14738
|
}
|
|
14623
14739
|
],
|
|
14624
14740
|
WEBHOOK: [
|
|
@@ -18928,7 +19044,7 @@ var projectCreatedPipeline = (ctx, objectType, pipeline2) => {
|
|
|
18928
19044
|
label: pipeline2.label,
|
|
18929
19045
|
displayOrder: pipeline2.displayOrder,
|
|
18930
19046
|
stages: pipeline2.stages.map((stage, index) => ({
|
|
18931
|
-
id: `created-stage:${index + 1}`,
|
|
19047
|
+
id: stage.id ?? `created-stage:${index + 1}`,
|
|
18932
19048
|
label: stage.label,
|
|
18933
19049
|
displayOrder: stage.displayOrder,
|
|
18934
19050
|
metadata: { ...stage.metadata ?? {} }
|
|
@@ -20512,6 +20628,7 @@ var HIGH_STAGE_LIMIT_OBJECTS = /* @__PURE__ */ new Set(["deals", "tickets"]);
|
|
|
20512
20628
|
var validateCreatePipeline = (op, index, _ctx) => {
|
|
20513
20629
|
const issues = [];
|
|
20514
20630
|
const stageLabels = /* @__PURE__ */ new Set();
|
|
20631
|
+
const stageRefs = /* @__PURE__ */ new Set();
|
|
20515
20632
|
for (const stage of op.pipeline.stages) {
|
|
20516
20633
|
if (stageLabels.has(stage.label)) {
|
|
20517
20634
|
issues.push({
|
|
@@ -20522,6 +20639,17 @@ var validateCreatePipeline = (op, index, _ctx) => {
|
|
|
20522
20639
|
});
|
|
20523
20640
|
}
|
|
20524
20641
|
stageLabels.add(stage.label);
|
|
20642
|
+
if (stage.ref) {
|
|
20643
|
+
if (stageRefs.has(stage.ref)) {
|
|
20644
|
+
issues.push({
|
|
20645
|
+
severity: "error",
|
|
20646
|
+
operation_index: index,
|
|
20647
|
+
code: "DUPLICATE_STAGE_REF",
|
|
20648
|
+
message: `Stage ref '${stage.ref}' is duplicated within the pipeline definition`
|
|
20649
|
+
});
|
|
20650
|
+
}
|
|
20651
|
+
stageRefs.add(stage.ref);
|
|
20652
|
+
}
|
|
20525
20653
|
}
|
|
20526
20654
|
if (OBJECTS_WITH_PROBABILITY.has(op.object_type)) {
|
|
20527
20655
|
for (const stage of op.pipeline.stages) {
|
|
@@ -20630,19 +20758,31 @@ var createPipelineHandler = {
|
|
|
20630
20758
|
validate: validateCreatePipeline,
|
|
20631
20759
|
validateEffectful: validateCreatePipelineEffectful,
|
|
20632
20760
|
preCheck: preCheckCreatePipeline,
|
|
20633
|
-
declarePlanRefs: (op, index, ctx) =>
|
|
20634
|
-
|
|
20635
|
-
|
|
20636
|
-
|
|
20637
|
-
|
|
20638
|
-
|
|
20639
|
-
|
|
20640
|
-
|
|
20761
|
+
declarePlanRefs: (op, index, ctx) => [
|
|
20762
|
+
...declarePlanRef(ctx, {
|
|
20763
|
+
ref: op.ref,
|
|
20764
|
+
sourceOperationIndex: index,
|
|
20765
|
+
kind: "pipeline",
|
|
20766
|
+
primitive: "string",
|
|
20767
|
+
projectedValue: `plan-ref:pipeline:${index + 1}`,
|
|
20768
|
+
objectType: op.object_type
|
|
20769
|
+
}),
|
|
20770
|
+
...declareIndexedPlanRefs(ctx, {
|
|
20771
|
+
items: op.pipeline.stages,
|
|
20772
|
+
sourceOperationIndex: index,
|
|
20773
|
+
kind: "pipeline_stage",
|
|
20774
|
+
primitive: "string",
|
|
20775
|
+
getRef: (stage) => stage.ref,
|
|
20776
|
+
getProjectedValue: (_stage, itemIndex) => makeSyntheticStringRefValue("pipeline_stage", index, itemIndex),
|
|
20777
|
+
getObjectType: () => op.object_type
|
|
20778
|
+
})
|
|
20779
|
+
],
|
|
20641
20780
|
projectValidationState: (op, index, ctx) => projectCreatedPipeline(ctx, op.object_type, {
|
|
20642
20781
|
id: op.ref ? `plan-ref:pipeline:${index + 1}` : void 0,
|
|
20643
20782
|
label: op.pipeline.label,
|
|
20644
20783
|
displayOrder: op.pipeline.display_order,
|
|
20645
|
-
stages: op.pipeline.stages.map((stage) => ({
|
|
20784
|
+
stages: op.pipeline.stages.map((stage, stageIndex) => ({
|
|
20785
|
+
id: stage.ref ? makeSyntheticStringRefValue("pipeline_stage", index, stageIndex) : void 0,
|
|
20646
20786
|
label: stage.label,
|
|
20647
20787
|
displayOrder: stage.display_order,
|
|
20648
20788
|
metadata: stage.metadata
|
|
@@ -20671,11 +20811,22 @@ var createPipelineHandler = {
|
|
|
20671
20811
|
type: "create_pipeline",
|
|
20672
20812
|
status: "success",
|
|
20673
20813
|
records_affected: 1,
|
|
20674
|
-
affected_ids: [result.id]
|
|
20814
|
+
affected_ids: [result.id],
|
|
20815
|
+
outputs: [
|
|
20816
|
+
...collectSingleOutputRef(op.ref, "pipeline", "string", result.id, op.object_type),
|
|
20817
|
+
...collectIndexedOutputRefs({
|
|
20818
|
+
items: op.pipeline.stages,
|
|
20819
|
+
values: result.stages.map((stage) => stage.id),
|
|
20820
|
+
kind: "pipeline_stage",
|
|
20821
|
+
primitive: "string",
|
|
20822
|
+
getRef: (stage) => stage.ref,
|
|
20823
|
+
getObjectType: () => op.object_type
|
|
20824
|
+
})
|
|
20825
|
+
]
|
|
20675
20826
|
})),
|
|
20676
20827
|
catchAllToFailed("create_pipeline", index)
|
|
20677
20828
|
),
|
|
20678
|
-
collectOutputRefs: (
|
|
20829
|
+
collectOutputRefs: () => [],
|
|
20679
20830
|
postCheck: (op, index, result) => {
|
|
20680
20831
|
if (result.status !== "success") return Effect77.succeed([]);
|
|
20681
20832
|
return pipe59(
|
|
@@ -25291,6 +25442,12 @@ var ENUMERATION_INVALID_OPERATORS = /* @__PURE__ */ new Set([
|
|
|
25291
25442
|
"IS_EQUAL_TO",
|
|
25292
25443
|
"IS_NOT_EQUAL_TO"
|
|
25293
25444
|
]);
|
|
25445
|
+
var ALL_PROPERTY_EXISTENCE_OPERATORS = /* @__PURE__ */ new Set([
|
|
25446
|
+
"IS_KNOWN",
|
|
25447
|
+
"IS_UNKNOWN",
|
|
25448
|
+
"IS_BLANK",
|
|
25449
|
+
"IS_NOT_BLANK"
|
|
25450
|
+
]);
|
|
25294
25451
|
var isCompatibleEnrollmentOperationType = (operationType, expectedOperationType, propertyType) => operationType === expectedOperationType || operationType === "ALL_PROPERTY" || operationType === "TIME_RANGED" && (propertyType === "date" || propertyType === "datetime");
|
|
25295
25452
|
var collectPropertyFiltersFromBranches = (branches, parentObjectTypeId, parentEventTypeId) => {
|
|
25296
25453
|
const refs = [];
|
|
@@ -25424,6 +25581,15 @@ var validateWorkflowEnrollmentMetadata = (params) => {
|
|
|
25424
25581
|
});
|
|
25425
25582
|
continue;
|
|
25426
25583
|
}
|
|
25584
|
+
if (propertyDefinition.type === "bool" && filterRef.operationType === "ALL_PROPERTY" && filterRef.operator !== void 0 && !ALL_PROPERTY_EXISTENCE_OPERATORS.has(filterRef.operator)) {
|
|
25585
|
+
add({
|
|
25586
|
+
severity: "error",
|
|
25587
|
+
operation_index: operationIndex,
|
|
25588
|
+
code: "INVALID_ENROLLMENT_FILTER_OPERATION_TYPE",
|
|
25589
|
+
message: `Workflow enrollment filter property '${filterRef.property}' is boolean but uses operator '${filterRef.operator}' with operationType 'ALL_PROPERTY'. Use operationType 'BOOL' for true/false checks, or keep 'ALL_PROPERTY' only for existence operators ${Array.from(ALL_PROPERTY_EXISTENCE_OPERATORS).join(", ")}.`
|
|
25590
|
+
});
|
|
25591
|
+
continue;
|
|
25592
|
+
}
|
|
25427
25593
|
if (isCompatibleEnrollmentOperationType(filterRef.operationType, expectedOperationType, propertyDefinition.type)) {
|
|
25428
25594
|
if (propertyDefinition.type === "enumeration" && filterRef.operator !== void 0 && ENUMERATION_INVALID_OPERATORS.has(filterRef.operator)) {
|
|
25429
25595
|
add({
|
|
@@ -25467,6 +25633,12 @@ var ENUMERATION_INVALID_OPERATORS2 = /* @__PURE__ */ new Set([
|
|
|
25467
25633
|
"IS_EQUAL_TO",
|
|
25468
25634
|
"IS_NOT_EQUAL_TO"
|
|
25469
25635
|
]);
|
|
25636
|
+
var ALL_PROPERTY_EXISTENCE_OPERATORS2 = /* @__PURE__ */ new Set([
|
|
25637
|
+
"IS_KNOWN",
|
|
25638
|
+
"IS_UNKNOWN",
|
|
25639
|
+
"IS_BLANK",
|
|
25640
|
+
"IS_NOT_BLANK"
|
|
25641
|
+
]);
|
|
25470
25642
|
var isCompatibleOperationType = (operationType, expectedOperationType, propertyType) => operationType === expectedOperationType || operationType === "ALL_PROPERTY" || operationType === "TIME_RANGED" && (propertyType === "date" || propertyType === "datetime");
|
|
25471
25643
|
var validateListBranchFilterNode = (params) => {
|
|
25472
25644
|
const { actionId, node, path: path6, operationIndex } = params;
|
|
@@ -25746,6 +25918,15 @@ var validateWorkflowListBranchMetadata = (params) => {
|
|
|
25746
25918
|
});
|
|
25747
25919
|
continue;
|
|
25748
25920
|
}
|
|
25921
|
+
if (propertyDefinition.type === "bool" && propertyRef.operationType === "ALL_PROPERTY" && propertyRef.operator !== void 0 && !ALL_PROPERTY_EXISTENCE_OPERATORS2.has(propertyRef.operator)) {
|
|
25922
|
+
add({
|
|
25923
|
+
severity: "error",
|
|
25924
|
+
operation_index: operationIndex,
|
|
25925
|
+
code: "WORKFLOW_LIST_BRANCH_INVALID_FILTER_OPERATION_TYPE",
|
|
25926
|
+
message: `Action '${propertyRef.actionId}' LIST_BRANCH property '${propertyRef.property}' is boolean but uses operator '${propertyRef.operator}' with operationType 'ALL_PROPERTY'. Use operationType 'BOOL' for true/false checks, or keep 'ALL_PROPERTY' only for existence operators ${Array.from(ALL_PROPERTY_EXISTENCE_OPERATORS2).join(", ")}.`
|
|
25927
|
+
});
|
|
25928
|
+
continue;
|
|
25929
|
+
}
|
|
25749
25930
|
if (!isCompatibleOperationType(propertyRef.operationType, expectedOperationType, propertyDefinition.type)) {
|
|
25750
25931
|
add({
|
|
25751
25932
|
severity: "error",
|
|
@@ -26471,6 +26652,86 @@ var NUMBER_STRING_FIELD_KINDS = {
|
|
|
26471
26652
|
labelToApply: ["association_label"],
|
|
26472
26653
|
labelToRemove: ["association_label"]
|
|
26473
26654
|
};
|
|
26655
|
+
var LEGACY_PIPELINE_TEMPLATE_PATTERN = /^\s*\{\{\s*pipeline\.[^}]+\}\}\s*$/;
|
|
26656
|
+
var WORKFLOW_PROPERTY_TARGET_KINDS = {
|
|
26657
|
+
pipeline: ["pipeline"],
|
|
26658
|
+
dealstage: ["pipeline_stage"],
|
|
26659
|
+
hs_pipeline_stage: ["pipeline_stage"]
|
|
26660
|
+
};
|
|
26661
|
+
var getWorkflowPropertyTargetKinds = (targetProperty) => targetProperty ? WORKFLOW_PROPERTY_TARGET_KINDS[targetProperty] : void 0;
|
|
26662
|
+
var isLegacyPipelineTemplate = (value) => typeof value === "string" && LEGACY_PIPELINE_TEMPLATE_PATTERN.test(value);
|
|
26663
|
+
var resolveWorkflowValueSpecForValidation = (valueSpec, params) => {
|
|
26664
|
+
const kinds = getWorkflowPropertyTargetKinds(params.targetProperty);
|
|
26665
|
+
if (!kinds || !valueSpec || typeof valueSpec !== "object") return void 0;
|
|
26666
|
+
const record = valueSpec;
|
|
26667
|
+
const rawStaticValue = record.staticValue;
|
|
26668
|
+
if (isLegacyPipelineTemplate(rawStaticValue)) {
|
|
26669
|
+
return {
|
|
26670
|
+
value: valueSpec,
|
|
26671
|
+
issues: [{
|
|
26672
|
+
severity: "error",
|
|
26673
|
+
operation_index: params.operationIndex,
|
|
26674
|
+
code: "WORKFLOW_LEGACY_PIPELINE_TEMPLATE_UNSUPPORTED",
|
|
26675
|
+
message: `${params.path}.staticValue uses legacy pipeline template syntax; use a typed plan ref instead`
|
|
26676
|
+
}]
|
|
26677
|
+
};
|
|
26678
|
+
}
|
|
26679
|
+
if (!(typeof rawStaticValue === "string" || isPlanRefValue(rawStaticValue))) return void 0;
|
|
26680
|
+
const result = resolveStringFieldForValidation(rawStaticValue, {
|
|
26681
|
+
ctx: params.ctx,
|
|
26682
|
+
operationIndex: params.operationIndex,
|
|
26683
|
+
fieldLabel: `${params.path}.staticValue`,
|
|
26684
|
+
kinds
|
|
26685
|
+
});
|
|
26686
|
+
if (!result.ok) {
|
|
26687
|
+
return {
|
|
26688
|
+
value: valueSpec,
|
|
26689
|
+
issues: result.issues
|
|
26690
|
+
};
|
|
26691
|
+
}
|
|
26692
|
+
return {
|
|
26693
|
+
value: {
|
|
26694
|
+
...record,
|
|
26695
|
+
staticValue: result.value
|
|
26696
|
+
},
|
|
26697
|
+
issues: []
|
|
26698
|
+
};
|
|
26699
|
+
};
|
|
26700
|
+
var resolveWorkflowValueSpecForExecution = (valueSpec, params) => {
|
|
26701
|
+
const kinds = getWorkflowPropertyTargetKinds(params.targetProperty);
|
|
26702
|
+
if (!kinds || !valueSpec || typeof valueSpec !== "object") return void 0;
|
|
26703
|
+
const record = valueSpec;
|
|
26704
|
+
const rawStaticValue = record.staticValue;
|
|
26705
|
+
if (isLegacyPipelineTemplate(rawStaticValue)) {
|
|
26706
|
+
return {
|
|
26707
|
+
ok: false,
|
|
26708
|
+
result: {
|
|
26709
|
+
index: params.operationIndex,
|
|
26710
|
+
type: params.operationType,
|
|
26711
|
+
status: "skipped",
|
|
26712
|
+
records_affected: 0,
|
|
26713
|
+
error_code: "WORKFLOW_LEGACY_PIPELINE_TEMPLATE_UNSUPPORTED",
|
|
26714
|
+
error: `${params.path}.staticValue uses legacy pipeline template syntax; use a typed plan ref instead`
|
|
26715
|
+
}
|
|
26716
|
+
};
|
|
26717
|
+
}
|
|
26718
|
+
if (!(typeof rawStaticValue === "string" || isPlanRefValue(rawStaticValue))) return void 0;
|
|
26719
|
+
const result = resolveStringFieldForExecution(rawStaticValue, {
|
|
26720
|
+
ctx: params.ctx,
|
|
26721
|
+
operationIndex: params.operationIndex,
|
|
26722
|
+
operationType: params.operationType,
|
|
26723
|
+
fieldLabel: `${params.path}.staticValue`,
|
|
26724
|
+
kinds
|
|
26725
|
+
});
|
|
26726
|
+
if (!result.ok) return result;
|
|
26727
|
+
return {
|
|
26728
|
+
ok: true,
|
|
26729
|
+
value: {
|
|
26730
|
+
...record,
|
|
26731
|
+
staticValue: result.value
|
|
26732
|
+
}
|
|
26733
|
+
};
|
|
26734
|
+
};
|
|
26474
26735
|
var resolveNestedForValidation = (value, params) => {
|
|
26475
26736
|
if (Array.isArray(value)) {
|
|
26476
26737
|
const issues2 = [];
|
|
@@ -26490,6 +26751,30 @@ var resolveNestedForValidation = (value, params) => {
|
|
|
26490
26751
|
const record = value;
|
|
26491
26752
|
const issues = [];
|
|
26492
26753
|
const next = {};
|
|
26754
|
+
if (typeof record.targetProperty === "string" && "value" in record) {
|
|
26755
|
+
const resolvedValueSpec = resolveWorkflowValueSpecForValidation(record.value, {
|
|
26756
|
+
ctx: params.ctx,
|
|
26757
|
+
operationIndex: params.operationIndex,
|
|
26758
|
+
path: params.path ? `${params.path}.value` : "value",
|
|
26759
|
+
targetProperty: record.targetProperty
|
|
26760
|
+
});
|
|
26761
|
+
if (resolvedValueSpec) {
|
|
26762
|
+
issues.push(...resolvedValueSpec.issues);
|
|
26763
|
+
next.targetProperty = record.targetProperty;
|
|
26764
|
+
next.value = resolvedValueSpec.value;
|
|
26765
|
+
for (const [key, raw] of Object.entries(record)) {
|
|
26766
|
+
if (key === "targetProperty" || key === "value") continue;
|
|
26767
|
+
const path6 = params.path ? `${params.path}.${key}` : key;
|
|
26768
|
+
const nested = resolveNestedForValidation(raw, {
|
|
26769
|
+
...params,
|
|
26770
|
+
path: path6
|
|
26771
|
+
});
|
|
26772
|
+
issues.push(...nested.issues);
|
|
26773
|
+
next[key] = nested.value;
|
|
26774
|
+
}
|
|
26775
|
+
return { value: next, issues };
|
|
26776
|
+
}
|
|
26777
|
+
}
|
|
26493
26778
|
for (const [key, raw] of Object.entries(record)) {
|
|
26494
26779
|
const path6 = params.path ? `${params.path}.${key}` : key;
|
|
26495
26780
|
if (key in STRING_FIELD_KINDS && (typeof raw === "string" || isPlanRefValue(raw))) {
|
|
@@ -26553,6 +26838,31 @@ var resolveNestedForExecution = (value, params) => {
|
|
|
26553
26838
|
}
|
|
26554
26839
|
const record = value;
|
|
26555
26840
|
const next = {};
|
|
26841
|
+
if (typeof record.targetProperty === "string" && "value" in record) {
|
|
26842
|
+
const resolvedValueSpec = resolveWorkflowValueSpecForExecution(record.value, {
|
|
26843
|
+
ctx: params.ctx,
|
|
26844
|
+
operationIndex: params.operationIndex,
|
|
26845
|
+
operationType: params.operationType,
|
|
26846
|
+
path: params.path ? `${params.path}.value` : "value",
|
|
26847
|
+
targetProperty: record.targetProperty
|
|
26848
|
+
});
|
|
26849
|
+
if (resolvedValueSpec) {
|
|
26850
|
+
if (!resolvedValueSpec.ok) return resolvedValueSpec;
|
|
26851
|
+
next.targetProperty = record.targetProperty;
|
|
26852
|
+
next.value = resolvedValueSpec.value;
|
|
26853
|
+
for (const [key, raw] of Object.entries(record)) {
|
|
26854
|
+
if (key === "targetProperty" || key === "value") continue;
|
|
26855
|
+
const path6 = params.path ? `${params.path}.${key}` : key;
|
|
26856
|
+
const nested = resolveNestedForExecution(raw, {
|
|
26857
|
+
...params,
|
|
26858
|
+
path: path6
|
|
26859
|
+
});
|
|
26860
|
+
if (!nested.ok) return nested;
|
|
26861
|
+
next[key] = nested.value;
|
|
26862
|
+
}
|
|
26863
|
+
return { ok: true, value: next };
|
|
26864
|
+
}
|
|
26865
|
+
}
|
|
26556
26866
|
for (const [key, raw] of Object.entries(record)) {
|
|
26557
26867
|
const path6 = params.path ? `${params.path}.${key}` : key;
|
|
26558
26868
|
if (key in STRING_FIELD_KINDS && (typeof raw === "string" || isPlanRefValue(raw))) {
|
|
@@ -29170,7 +29480,11 @@ var buildDispatcher = (handlers, options2) => {
|
|
|
29170
29480
|
(result) => pipe118(
|
|
29171
29481
|
collectOperationOutputRefs(resolved.op, index, result),
|
|
29172
29482
|
Effect138.map((outputs) => {
|
|
29173
|
-
const
|
|
29483
|
+
const mergedOutputs = [
|
|
29484
|
+
...result.outputs ?? [],
|
|
29485
|
+
...outputs
|
|
29486
|
+
];
|
|
29487
|
+
const nextResult = mergedOutputs.length > 0 ? { ...result, outputs: mergedOutputs } : result;
|
|
29174
29488
|
if (nextResult.outputs) {
|
|
29175
29489
|
for (const output of nextResult.outputs) {
|
|
29176
29490
|
state.ctx.outputsByRef.set(output.ref, output);
|