bitfocus / companion-module-generic-http

Generic HTTP module
MIT License
9 stars 19 forks source link

feat(actions): add ability to use custom variables in action options #13

Closed estilles closed 2 years ago

estilles commented 2 years ago

Enable the http: GET, http: PUT and http: POST actions to accept custom variables within the URI, Body(JSON) and header input(JSON) options.

I've also refactored/simplified the instance action method.

Usage example: image

Resolves #12 Signed-off-by: Johnny Estilles johnny@estilles.com

cprima commented 2 years ago

This would allow for a very speedy duplication of buttons, to make slight variants of a button.

krocheck commented 2 years ago

This is now in conflict due to #11. Can you please resolve in the refactor, noting that PATCH and DELETE commands were added. Thx

estilles commented 2 years ago

@krocheck ... Thanks. Will Do.

FYI ... I just checked out #11 (to see what I need to resolve) and it seems it adds the PATCH/DELETE functionality to the action handler, but it doesn't add the actual actions.

Do you want me to go ahead and add them as well?

https://github.com/bitfocus/companion-module-generic-http/blob/master/index.js#L69-L133

krocheck commented 2 years ago

ugh… yes please. good catch!

estilles commented 2 years ago

Hey @krocheck ... I just realized a ran prettier (force of habit) and it reformatted the entire file. I kinda prefer the prettier formatted version anyway. Are you okay with that?

estilles commented 2 years ago

@krocheck ... should I remove the prettier fixes?

krocheck commented 2 years ago

no, its fine. I'm making the rounds to here in a bit

krocheck commented 2 years ago

@estilles can you check me on that change I just pushed pls

estilles commented 2 years ago

@estilles can you check me on that change I just pushed pls

Nice! I likes! Thanks @krocheck