Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Initial implementation of an Http reaction. This enables the user to craft Http calls that will be invoked when query result set changes occur.
The URL of the request and the payload can be constructed from a handlebars template.
For example, the following configuration will
post
tohttps://api.github.com/repos/{{repo}}/issues/{{issue_number}}/comments
, where the variables are sourced from the result set item that was added. The JSON body of the request is also constructed using handlebars.Configuration Schema
Reaction-Level configuration
baseUrl
: The base URL to use for all Http requests that will be made. eg.https://api.github.com
. Query specific requests will build on this URL by adding a path,token
(optional): The bearer token to use for authentication.Per-Query Configuration
The following 3 sections can be included per query
added
(optional): Describes the Http request for items added to the result set.updated
(optional): Describes the Http request for items updated the result set.deleted
(optional): Describes the Http request for items deleted from the result set.Each of these will describe the Http request to make for
added
,updated
, anddeleted
changes respectively.The configuration for each of these is as follows:
url
: The path to append to thebaseUrl
for the request. This can be a handlebars template, where you can merge data from the result set diff. Added results will have anafter
field that contains an object that is the added item, updated results will havebefore
andafter
objects, and deleted results will only have abefore
object. For example:/repos/{{after.repo}}/issues/{{after.issue_number}}/comments
method
: The Http method to use,PUT
,POST
,GET
,DELETE
, etc.body
: The body of the request. This can be a handlebars template, where you can merge data from the result set diff. Added results will have anafter
field that contains an object that is the added item, updated results will havebefore
andafter
objects, and deleted results will only have abefore
object.headers
: An object containing any additional custom headers to include in the Http request.What is missing