MCPcopy Create free account
hub / github.com/Shazbot/WH3-Mod-Manager / executeGenerateRowsNode

Function executeGenerateRowsNode

src/nodeExecutor.ts:4699–5426  ·  view source on GitHub ↗
(
  nodeId: string,
  textValue: string,
  inputData: DBTablesNodeData,
  rawConfig?: unknown,
  executionContext?: FlowExecutionContext,
)

Source from the content-addressed store, hash-verified

4697}
4698
4699async function executeGenerateRowsNode(
4700 nodeId: string,
4701 textValue: string,
4702 inputData: DBTablesNodeData,
4703 rawConfig?: unknown,
4704 executionContext?: FlowExecutionContext,
4705): Promise<NodeExecutionResult> {
4706 hotPathLog(executionContext, `Generate Rows Node ${nodeId}: Starting execution`);
4707
4708 // 1. Parse configuration from textValue
4709 let config: {
4710 transformations: Array<{
4711 sourceColumn: string;
4712 transformationType:
4713 | "none"
4714 | "prefix"
4715 | "suffix"
4716 | "add"
4717 | "subtract"
4718 | "multiply"
4719 | "divide"
4720 | "concatenate"
4721 | "formula"
4722 | "counter"
4723 | "counter_range"
4724 | "filterequal"
4725 | "filternotequal";
4726 prefix?: string;
4727 suffix?: string;
4728 numericValue?: number;
4729 startNumber?: number;
4730 rangeStart?: string; // For counter_range (supports flow options)
4731 endNumber?: string; // For counter_range (supports flow options)
4732 rangeIncrement?: string; // For counter_range (supports flow options)
4733 separator?: string;
4734 formula?: string;
4735 filterValue?: string;
4736 outputColumnName: string;
4737 targetTableHandleId: string; // Which output table this transformation is for
4738 }>;
4739 outputTables: Array<{
4740 handleId: string;
4741 name: string;
4742 existingTableName: string;
4743 tableVersion?: number;
4744 columnMapping: string[];
4745 staticValues?: Record<string, string>;
4746 }>;
4747 DBNameToDBVersions?: Record<string, DBVersion[]>;
4748 customSchemaData?: Array<{ id: string; name: string; type: string }> | null;
4749 };
4750
4751 try {
4752 hotPathLog(executionContext, `Generate Rows Node ${nodeId}: textValue to parse:`, textValue);
4753 const parsedConfig = getNodeConfig<typeof config>(rawConfig, textValue);
4754 if (!parsedConfig) {
4755 throw new Error("Invalid configuration");
4756 }

Callers 1

executeNodeActionFunction · 0.85

Calls 8

getSchemaForGameFunction · 0.90
getDefaultTableVersionsFunction · 0.90
typeToBufferFunction · 0.90
hotPathLogFunction · 0.85
getNodeConfigFunction · 0.85
getRowsForPackedFileFunction · 0.70
addMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected