Before, TropoProvision.makeApiCall (used internally by all the TropoProvision methods) would emit responseCode and responseBody events, but there was no way for a consumer of the library to know when to stop expecting responseBody events - i.e., when the response was actually done.
This commit adds an 'end' event to TropoProvision which is called when we receive the end event on a request made against Tropo's servers.
Merge branch 'provisioning_api_query_numbers'
TropoProvision now emits "end" when the response from Tropo ends
provisioning now emits "end" on response end from tropo
typo in provisioning viewAddresses URL
Merge branch 'patch-1'
In retrospect, having used this a bit more now, I'm not sure this was the right approach. What would you think of changing it so that the data chunks are accumulated until the end is received, and then only emit responseBody on end? I think this is how the code in tropo-session works, and I'd be happy to submit a pull request with that change in tropo-provision.
I actually like that approach a bit better. I'll pull that in if you have a chance to make that change.
Merge branch 'master' of github.com:tropo/tropo-webapi-node
provisioning no longer emits "end" and instead accumulates response d…
…ata and only emits responseBody once
removed unused require(sys) which causes node 0.6 to print warnings
Sorry for the delay, but I've made the change now so instead of emitting 'end', provisioning goes back to just emitting 'responseBody' but now accumulates chunks.