How to create an iOS App Intent that can execute a JS function, be triggered by a Shortcuts automation?

Whats the best approach to create a single iOS AppIntents to be able to trigger a Capacitor JavaScript function (to fetch a file) with iOS Shortcuts automation (like every midnight)?

It thought this can be done with capacitor-plugin-siri-shortcuts, but that seems not the case (issue).

This ios-app-intents-with-ionic tutorial goes into the right direction (link), but I want to trigger a JS function inside Capacitor, not a dialog in a chat.

Has this been done before? Is there a tutorial available?

Related solution from a Reddit post to run a native Swift function within CapacitorJS framework. You can register an AppIntent from any Swift file, it just needs to be included in the project.

I needed to trigger a download, but messed so much in the Swift native part, that I will keep the download part there.