The code that is emitted when the consumer cancels the stream is now swallowed.
Refactored code that was misusing Promise.
Consumer-facing changes
Added authToken config option.
Renamed endpoint -> domain.
Exported API types under Query namespace.
New GenerationEndEvent is emitted to signify when the generated response is complete.
New UnexpectedEvent surfaces any stream events that were unexpected. This provides future-proofing against stream events that might be added to the API in the future.
New RequestErrorEvent (server responds with non-200), GenericErrorEvent (when the buffer logic throws a JS error, which shouldn't happen), and UnexpectedErrorEvent (catch-all for other error cases) surface additional error cases.
Internal changes
Consumer-facing changes
authToken
config option.endpoint
->domain
.Query
namespace.GenerationEndEvent
is emitted to signify when the generated response is complete.UnexpectedEvent
surfaces any stream events that were unexpected. This provides future-proofing against stream events that might be added to the API in the future.RequestErrorEvent
(server responds with non-200),GenericErrorEvent
(when the buffer logic throws a JS error, which shouldn't happen), andUnexpectedErrorEvent
(catch-all for other error cases) surface additional error cases.