prismatic-io / spectral

Prismatic's typescript library for custom components
https://prismatic.io/docs/spectral/custom-component-library
35 stars 2 forks source link

CNI - Allow usage of existing triggers w/ custom flow onInstanceDelete and onInstanceDeploy behavior #269

Open pattra opened 1 week ago

pattra commented 1 week ago

Previously if a CNI set a flow's onTrigger to a component reference and also defined onInstanceDelete or onInstanceDeploy behavior, the flow's onInstance methods would be ignored.

This PR makes it such that if a flow defines both a component reference onTrigger (either explicitly or via default fallback) along with onInstance behavior, all defined onInstance behavior will execute.

In the case of both the component & the flow having defined onInstance behavior (e.g. they each have their own onInstanceDeploy definitions), the returned responses will be deep-merged with preference given to the flow's response if there's a conflict.