From 86a7892aa463b4fcf3b3c4962712f69128db4f3d Mon Sep 17 00:00:00 2001 From: oleksandravalko Date: Fri, 21 Nov 2025 19:01:43 +0100 Subject: [PATCH 1/3] fix(new-finished-actor-run-instant) 31: add actorSource input field, which determines the list of available actors in actorId list content --- components/apify/apify.app.mjs | 31 ++++++++----- .../new-finished-actor-run-instant.mjs | 43 ++++++++++++++++--- 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/components/apify/apify.app.mjs b/components/apify/apify.app.mjs index 8f9c2e6c3fbd9..76765f08596f6 100644 --- a/components/apify/apify.app.mjs +++ b/components/apify/apify.app.mjs @@ -32,18 +32,10 @@ export default { page, actorSource, }) { actorSource ??= "recently-used"; - const listFn = actorSource === "store" - ? this.listActors - : this.listUserActors; - const { items } = await listFn({ - offset: LIMIT * page, - limit: LIMIT, + return await this.getActorOptions({ + page, + actorSource, }); - - return items.map((actor) => ({ - label: this.formatActorOrTaskLabel(actor), - value: actor.id, - })); }, }, taskId: { @@ -149,6 +141,23 @@ export default { ], }); }, + async getActorOptions({ + page = 0, actorSource = "recently-used", + }) { + const listFn = actorSource === "store" + ? this.listActors + : this.listUserActors; + + const { items } = await listFn({ + offset: LIMIT * page, + limit: LIMIT, + }); + + return items.map((actor) => ({ + label: this.formatActorOrTaskLabel(actor), + value: actor.id, + })); + }, getAuthToken() { return this.$auth.api_token; }, diff --git a/components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs b/components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs index 14611eda57639..88a4c8cdd3fd1 100644 --- a/components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs +++ b/components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs @@ -1,24 +1,57 @@ import common from "../common/base.mjs"; import sampleEmit from "./test-event.mjs"; +import apify from "../../apify.app.mjs"; export default { ...common, key: "apify-new-finished-actor-run-instant", name: "New Finished Actor Run (Instant)", description: "Emit new event when a selected Actor is run and finishes.", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", props: { ...common.props, db: "$.service.db", - actorId: { - propDefinition: [ - common.props.apify, - "actorId", + apify, + actorSource: { + type: "string", + label: "Search Actors from", + description: "Where to search for Actors. Valid options are Store and Recently used Actors.", + options: [ + { + label: "Apify Store Actors", + value: "store", + }, + { + label: "Recently used Actors", + value: "recently-used", + }, ], + default: "recently-used", + reloadProps: true, }, }, + additionalProps() { + console.log("=== additionalProps DEBUG ==="); + console.log("apify.propDefinitions:", apify.propDefinitions); + + const props = {}; + + if (this.actorSource) { + props.actorId = { + ...apify.propDefinitions.actorId, // it doesn't contain options() method + options: async ({ page }) => { + return await this.apify.getActorOptions({ + page, + actorSource: this.actorSource, + }); + }, + }; + } + + return props; + }, methods: { ...common.methods, getCondition() { From 94f8879a9253ca73c82f1e638269e64c3d709d35 Mon Sep 17 00:00:00 2001 From: oleksandravalko Date: Tue, 25 Nov 2025 11:19:55 +0100 Subject: [PATCH 2/3] fix(new-finished-actor-run-instant) 31: remove logs --- .../new-finished-actor-run-instant.mjs | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs b/components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs index 88a4c8cdd3fd1..8e195953fe796 100644 --- a/components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs +++ b/components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs @@ -33,9 +33,6 @@ export default { }, }, additionalProps() { - console.log("=== additionalProps DEBUG ==="); - console.log("apify.propDefinitions:", apify.propDefinitions); - const props = {}; if (this.actorSource) { From cdf0cb683fbc17d8c43eff58feff33f1f854479d Mon Sep 17 00:00:00 2001 From: oleksandravalko Date: Fri, 28 Nov 2025 13:13:58 +0100 Subject: [PATCH 3/3] fix(apify) 31: actorId field lists both owned and store actors IDs if actor source is set on "recently-used" --- components/apify/apify.app.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/apify/apify.app.mjs b/components/apify/apify.app.mjs index 76765f08596f6..4fe1e06278b29 100644 --- a/components/apify/apify.app.mjs +++ b/components/apify/apify.app.mjs @@ -226,7 +226,6 @@ export default { listUserActors(opts = {}) { return this._client().actors() .list({ - my: true, sortBy: "stats.lastRunStartedAt", desc: true, ...opts,