-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(schema) support hook to poll triggers INT-15776 #432
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@casshill is this ready for review? It's still marked as draft, so I wasn't sure.
In any case, looks good! I'm not sure how much you care about hiding the new value from the docs, but we have some code for that in here:
zapier-platform/packages/schema/lib/utils/buildDocs.js
Lines 121 to 136 in e4cacfa
if (_.get(property, 'docAnnotation.hide')) { | |
return ''; | |
} else if (_.get(property, 'docAnnotation.required')) { | |
// can also support keys besides "required" | |
const annotation = property.docAnnotation.required; | |
if (annotation.type === 'replace') { | |
isRequired = annotation.value; | |
} else if (annotation.type === 'append') { | |
isRequired += annotation.value; | |
} else { | |
throw new Error(`unrecognized docAnnotation type: ${annotation.type}`); | |
} | |
} | |
return `${quoteOrNa(key)} | ${isRequired} | ${typeOrLink(property)} | ${ | |
property.description || NO_DESCRIPTION | |
}`; |
We don't have anything for hiding a specific enum, but we could add it.
It's ready for feedback and suggestions :D |
@xavdid I couldn't see how to make the doc annotations hide for sub-components of a property, it seemed to be more for full property blocks? Eg I don't think I can show docs for one enum value 'hook', but not for the second enum value 'hook_to_poll' (only for the whole enum property) It might make more sense (added in the latest commit) to make a new operation schema, particular as we need to use performList instead of perform. What do you think of that as opposed to adding a new enum to the basic hook operation schema? I think we have the same issue with hiding the docs though. It's probably more subtle to just add an enum value if we don't want to publish the full docs though, so perhaps then enum is better for the soft launch and the new operation schema for the hard launch |
Right, there's not currently support for hiding a specific property. so we could add support for that, or do something different (such as a new schema). If hook-to-poll doesn't have a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! this is looking good.
I haven't taken a super close look, but if you've done some testing then this should be safe enough! We'll want to push a test app to staging and actually make sure it all runs, but it should be pretty straightforward.
Add support for hook_to_poll style triggers (new schema)