Update for Asana 1.1 and allow add use of body for new tasks #256
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.
The idea is to be able to read the values that changed, such as
id
togid
. Also I wanted the ability to easily provide any necessary detail for a new Asana task as defined here. To do this easily the body of the POST is populated.One can merge a template of task details with other detail to form the
data
object of the POST body.Example:
I have a template for inserting the new task into two Asana projects. It is stored in my
configConsts.lua
.Two things are necessary to make this work. The first is being able to join tables. I could not get the built-in or
hs.fnutils
table tools to work for me. I added a couple of functions that work. I have not tried to improve them. The second thing is simply designating the content type so the Asana service can decode the body of the POST.I did not do much with documentation. . .
Here is an example of how I registered this Asana spoon with
Seal
. (Almost the same as before.)I am not sure if it is documented but I am storing the API key in the macOS keychain and retrieve it in the config like this.