zapier-platform
zapier-platform copied to clipboard
[Bug]: Can't stash files in a Trigger hook's perform.
Bug Description
You can't stash files in a Trigger hook's perform.
Reproduction Steps
- Use an Typescript app
- Create a trigger file with a perform method, etc... and declare it as a triggers in your index
- Create hydrator.js with a downloadFile() method which use z.stashfiles with binary data, and declare it as an hydrators in your index
- Import hydrators and call hydrators.downloadFile() in your perform methods from your trigger. If you're looking at the logs, it's going into the downloadFile method, but you're getting a "Files can only be stashed within a create or hydracation function/method" error.
Zapier Platform version
15.10.0
Node.js version
20.11.0
Your Operating System
Windows 10
npm/yarn version
10.2.4
App ID
No response
More Details
The problem is that only Hydrators and Creates can stash files, but even if you use an hydrator methods IN a hook's perform, the zapier.event will start by triggers.(...).perform, and not by hydrations. So an error will be throwed. (altought documentation is saying that you can stash files in an hydration method or an hook's perform...) This is at least the case in a typescript project.