Skip to content

Commit b9650d1

Browse files
authored
fix: removed getDefaultInputsFromBuild and its usage (#74)
1 parent 52e52dd commit b9650d1

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

nodes/Apify/resources/executeActor.ts

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,15 @@ export async function executeActor(
6262
build = await getDefaultBuild.call(this, actorId);
6363
}
6464

65-
// 3. Get default input for this build
66-
const defaultInput = getDefaultInputsFromBuild(build);
67-
68-
// 4. Merge default input and user's input (user's input overrides)
69-
const mergedInput = { ...defaultInput, ...userInput };
70-
71-
// 5. Prepare query string
65+
// 3. Prepare query string
7266
const qs: Record<string, any> = {};
7367
if (timeout != null) qs.timeout = timeout;
7468
if (memory != null) qs.memory = memory;
7569
if (build?.buildNumber) qs.build = build.buildNumber;
7670
qs.waitForFinish = 0; // set initial run actor to not wait for finish
7771

78-
// 6. Run the actor
79-
const run = await runActorApi.call(this, actorId, mergedInput, qs);
72+
// 4. Run the actor
73+
const run = await runActorApi.call(this, actorId, userInput, qs);
8074
if (!run?.data?.id) {
8175
throw new NodeApiError(this.getNode(), {
8276
message: `Run ID not found after running the actor`,
@@ -86,7 +80,7 @@ export async function executeActor(
8680
const runId = run.data.id;
8781
let lastRunData = run.data;
8882

89-
// 7. If waitForFinish is true, poll for run status until it reaches a terminal state
83+
// 5. If waitForFinish is true, poll for run status until it reaches a terminal state
9084
if (waitForFinish) {
9185
lastRunData = await pollRunStatus.call(this, runId);
9286
}
@@ -134,25 +128,6 @@ export async function getDefaultBuild(this: IExecuteFunctions, actorId: string)
134128
return defaultBuildResp.data;
135129
}
136130

137-
export function getDefaultInputsFromBuild(build: any) {
138-
const buildInputProperties = build?.actorDefinition?.input?.properties;
139-
const defaultInput: Record<string, any> = {};
140-
if (buildInputProperties && typeof buildInputProperties === 'object') {
141-
for (const [key, property] of Object.entries(buildInputProperties)) {
142-
if (
143-
property &&
144-
typeof property === 'object' &&
145-
'prefill' in property &&
146-
(property as any).prefill !== undefined &&
147-
(property as any).prefill !== null
148-
) {
149-
defaultInput[key] = (property as any).prefill;
150-
}
151-
}
152-
}
153-
return defaultInput;
154-
}
155-
156131
export async function runActorApi(
157132
this: IExecuteFunctions,
158133
actorId: string,

0 commit comments

Comments
 (0)